summaryrefslogtreecommitdiff
path: root/src/logging
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-05-17 15:18:03 -0400
committerDan Winship <danw@gnome.org>2013-05-21 09:30:09 -0300
commit8d44136dce3de1becd11e798edfc3f1eb3f4a36f (patch)
tree7fa4698ce75f92f7f053ba9738c5536acaa10581 /src/logging
parent7ff3d1500e8a9dcce4d12b7b879bf1d178b94bf8 (diff)
downloadNetworkManager-8d44136dce3de1becd11e798edfc3f1eb3f4a36f.tar.gz
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
Diffstat (limited to 'src/logging')
-rw-r--r--src/logging/nm-logging.c8
-rw-r--r--src/logging/nm-logging.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/logging/nm-logging.c b/src/logging/nm-logging.c
index e087fa9de6..509d1cf22f 100644
--- a/src/logging/nm-logging.c
+++ b/src/logging/nm-logging.c
@@ -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,
diff --git a/src/logging/nm-logging.h b/src/logging/nm-logging.h
index 00a92f5aaa..d26c81aed6 100644
--- a/src/logging/nm-logging.h
+++ b/src/logging/nm-logging.h
@@ -123,7 +123,7 @@ const char *nm_logging_all_domains_to_string (void);
#undef nm_error_str
gboolean nm_logging_setup (const char *level, const char *domains, GError **error);
-void nm_logging_start (gboolean become_daemon);
+void nm_logging_start (gboolean debug);
void nm_logging_shutdown (void);
#endif /* NM_LOGGING_H */