summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-01-10 18:44:48 -0800
committerGary E. Miller <gem@rellim.com>2019-01-10 18:44:48 -0800
commitf21370cadf091f7168fb8605a2051b86fc2b14d2 (patch)
tree99883c702dcc0077712f59b385e923dbad60f35a /libgpsd_core.c
parenta0dad21d058834c87e1728e186842f640ebcafc4 (diff)
downloadgpsd-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.c5
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);