diff options
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/wslog.c | 13 | ||||
-rw-r--r-- | wsutil/wslog.h | 10 |
2 files changed, 12 insertions, 11 deletions
diff --git a/wsutil/wslog.c b/wsutil/wslog.c index 47d6227d7d..9f53ce519c 100644 --- a/wsutil/wslog.c +++ b/wsutil/wslog.c @@ -84,8 +84,9 @@ static gboolean stdout_color_enabled = FALSE; static gboolean stderr_color_enabled = FALSE; -/* Use stderr for levels "info" and below. */ -static gboolean stderr_debug_enabled = FALSE; +/* Use stdout for levels "info" and below, for backward compatibility + * with GLib. */ +static gboolean stdout_logging_enabled = FALSE; static const char *registered_progname = DEFAULT_PROGNAME; @@ -929,7 +930,7 @@ static inline struct tm *get_localtime(time_t unix_time, struct tm **cookie) static inline FILE *console_file(enum ws_log_level level) { - if (level <= LOG_LEVEL_INFO && !stderr_debug_enabled) + if (level <= LOG_LEVEL_INFO && stdout_logging_enabled) return stdout; return stderr; } @@ -937,7 +938,7 @@ static inline FILE *console_file(enum ws_log_level level) static inline bool console_color_enabled(enum ws_log_level level) { - if (level <= LOG_LEVEL_INFO && !stderr_debug_enabled) + if (level <= LOG_LEVEL_INFO && stdout_logging_enabled) return stdout_color_enabled; return stderr_color_enabled; } @@ -1098,9 +1099,9 @@ void ws_log_console_writer(const char *domain, enum ws_log_level level, WS_DLL_PUBLIC -void ws_log_console_writer_set_use_stderr(bool use_stderr) +void ws_log_console_writer_set_use_stdout(bool use_stdout) { - stderr_debug_enabled = use_stderr; + stdout_logging_enabled = use_stdout; } diff --git a/wsutil/wslog.h b/wsutil/wslog.h index 437f12e163..943f2b017a 100644 --- a/wsutil/wslog.h +++ b/wsutil/wslog.h @@ -68,14 +68,14 @@ void ws_log_console_writer(const char *domain, enum ws_log_level level, const char *user_format, va_list user_ap); -/** Configure all log output to use stderr. +/** Configure log levels "info" and below to use stdout. * - * Normally log levels "info", "debug" and "noisy" are written to stdout. - * Calling this function with true configures these levels to be written - * to stderr as well. + * Normally all log messages are written to stderr. For backward compatibility + * with GLib calling this function with TRUE configures log levels "info", + * "debug" and "noisy" to be written to stdout. */ WS_DLL_PUBLIC -void ws_log_console_writer_set_use_stderr(bool use_stderr); +void ws_log_console_writer_set_use_stdout(bool use_stdout); /** Convert a numerical level to its string representation. */ |