main: add --debug, fix logging under systemd
When run with --no-daemon, NM used to duplicate all syslog output to stderr, for ease of debugging. But this meant it had to tell systemd to ignore stderr, so you wouldn't get duplicated log entries. But that meant we lost error messages that didn't go through nm_log. (eg, g_warning()s and g_return_if_fail()s). Fix this by making --no-daemon no longer duplicate syslog output to stderr, and removing the "StandardError=null" from the systemd service file. To get the old behavior, you can use --debug instead of --no-daemon. https://bugzilla.gnome.org/show_bug.cgi?id=700550
This commit is contained in:
@@ -349,12 +349,12 @@ nm_log_handler (const gchar *log_domain,
|
||||
}
|
||||
|
||||
void
|
||||
nm_logging_start (gboolean become_daemon)
|
||||
nm_logging_start (gboolean debug)
|
||||
{
|
||||
if (become_daemon)
|
||||
openlog (G_LOG_DOMAIN, LOG_PID, LOG_DAEMON);
|
||||
else
|
||||
if (debug)
|
||||
openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR | LOG_PID, LOG_USER);
|
||||
else
|
||||
openlog (G_LOG_DOMAIN, LOG_PID, LOG_DAEMON);
|
||||
|
||||
g_log_set_handler (G_LOG_DOMAIN,
|
||||
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
|
||||
|
Reference in New Issue
Block a user