Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[glibutil] Tweaked interpretation of environment variables
Two subsequent checks for (val > 0) didn't make any sense.
  • Loading branch information
monich committed May 7, 2021
1 parent c988372 commit 24ca68f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gutil_log.c
Expand Up @@ -657,12 +657,12 @@ gutil_log_init()
GDEBUG("Default log level %d", val);
}

if (gutil_parse_int(getenv("GUTIL_LOG_TIMESTAMP"), 0, &val) && val > 0) {
if (gutil_parse_int(getenv("GUTIL_LOG_TIMESTAMP"), 0, &val) && val >= 0) {
gutil_log_timestamp = (val > 0);
GDEBUG("Timestamps %s", (val > 0) ? "enabled" : "disabled");
}

if (gutil_parse_int(getenv("GUTIL_LOG_TID"), 0, &val) && val > 0) {
if (gutil_parse_int(getenv("GUTIL_LOG_TID"), 0, &val) && val >= 0) {
gutil_log_tid = (val > 0);
GDEBUG("Thread id prefix %s", (val > 0) ? "enabled" : "disabled");
}
Expand Down

0 comments on commit 24ca68f

Please sign in to comment.