static bool syslog_is_stream = false;
-static bool show_color = false;
+static int show_color = -1; /* tristate */
static bool show_location = false;
static bool show_time = false;
static bool show_tid = false;
iovec[n++] = IOVEC_MAKE_STRING(tid_string);
}
- if (show_color)
+ if (log_get_show_color())
get_log_colors(LOG_PRI(level), &on, &off, NULL);
if (show_location) {
const char *lon = "", *loff = "";
- if (show_color) {
+ if (log_get_show_color()) {
lon = ANSI_HIGHLIGHT_YELLOW4;
loff = ANSI_NORMAL;
}
}
bool log_get_show_color(void) {
- return show_color;
+ return show_color > 0; /* Defaults to false. */
}
void log_show_location(bool b) {