Commit ff527652 authored by Thomas Haller's avatar Thomas Haller

callouts: downgrade logging severity of messages to g_info() and g_debug()

In dispatcher, we install a log-handler which maps G_LOG_LEVEL_MESSAGE
to syslog priority LOG_NOTICE, which in turn causes journal to highlight
the message. We don't want that so instead use g_info() and g_debug()
which maps to lower syslog levels.

There is only one problem, in debug-mode, we don't use syslog but the
default logging handler from glib. In this case, we have to set
G_MESSAGES_DEBUG otherwise g_info()/g_debug() is suppressed.
parent 17779975
......@@ -173,12 +173,12 @@ _LOG_R_D_enabled (const Request *request)
return request->debug;
}
#define _LOG_R_D(_request, ...) _LOG(_request, NULL, FALSE, g_message, __VA_ARGS__)
#define _LOG_R_I(_request, ...) _LOG(_request, NULL, TRUE, g_message, __VA_ARGS__)
#define _LOG_R_D(_request, ...) _LOG(_request, NULL, FALSE, g_debug, __VA_ARGS__)
#define _LOG_R_I(_request, ...) _LOG(_request, NULL, TRUE, g_info, __VA_ARGS__)
#define _LOG_R_W(_request, ...) _LOG(_request, NULL, TRUE, g_warning, __VA_ARGS__)
#define _LOG_S_D(_script, ...) _LOG(NULL, _script, FALSE, g_message, __VA_ARGS__)
#define _LOG_S_I(_script, ...) _LOG(NULL, _script, TRUE, g_message, __VA_ARGS__)
#define _LOG_S_D(_script, ...) _LOG(NULL, _script, FALSE, g_debug, __VA_ARGS__)
#define _LOG_S_I(_script, ...) _LOG(NULL, _script, TRUE, g_info, __VA_ARGS__)
#define _LOG_S_W(_script, ...) _LOG(NULL, _script, TRUE, g_warning, __VA_ARGS__)
/*****************************************************************************/
......@@ -913,7 +913,16 @@ main (int argc, char **argv)
g_unix_signal_add (SIGTERM, signal_handler, GINT_TO_POINTER (SIGTERM));
g_unix_signal_add (SIGINT, signal_handler, GINT_TO_POINTER (SIGINT));
if (!debug)
if (debug) {
if (!g_getenv ("G_MESSAGES_DEBUG")) {
/* we log our regular messages using g_debug() and g_info().
* When we redirect glib logging to syslog, there is no problem.
* But in "debug" mode, glib will no print these messages unless
* we set G_MESSAGES_DEBUG. */
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
}
} else
logging_setup ();
loop = g_main_loop_new (NULL, FALSE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment