diff options
author | Gary E. Miller <gem@rellim.com> | 2019-01-10 18:44:48 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-01-10 18:44:48 -0800 |
commit | f21370cadf091f7168fb8605a2051b86fc2b14d2 (patch) | |
tree | 99883c702dcc0077712f59b385e923dbad60f35a /libgpsd_core.c | |
parent | a0dad21d058834c87e1728e186842f640ebcafc4 (diff) | |
download | gpsd-f21370cadf091f7168fb8605a2051b86fc2b14d2.tar.gz |
libgpsd_core: Short cicuit gpsd_log() on low log level.
This saves a bunch of unneeded pushing and popping.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index e46104ff..92330b7c 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -206,6 +206,11 @@ void gpsd_log(const struct gpsd_errout_t *errout, char buf[BUFSIZ]; va_list ap; + if (errout->debug < errlevel) { + /* nothing to do, get out */ + return; + } + buf[0] = '\0'; va_start(ap, fmt); gpsd_vlog(errout, errlevel, buf, sizeof(buf), fmt, ap); |