[network-manager-pptp/th/logging-bgo771664: 11/11] service: use syslog() for logging from pppd-plugin



commit b7d126169c90c16c63160704c1352a8f12b73122
Author: Thomas Haller <thaller redhat com>
Date:   Mon Sep 19 17:04:30 2016 +0200

    service: use syslog() for logging from pppd-plugin
    
    pppd itself uses syslog for logging. The plugin should hook into
    the same logging framework by using syslog() too.

 src/nm-pptp-pppd-plugin.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/nm-pptp-pppd-plugin.c b/src/nm-pptp-pppd-plugin.c
index 21c2442..1993b8f 100644
--- a/src/nm-pptp-pppd-plugin.c
+++ b/src/nm-pptp-pppd-plugin.c
@@ -60,11 +60,12 @@ struct {
 #define _NMLOG(level, ...) \
     G_STMT_START { \
          if (gl.log_level >= (level)) { \
-             g_print ("nm-pptp[%s] %-7s [helper-%ld] " _NM_UTILS_MACRO_FIRST (__VA_ARGS__) "\n", \
-                      gl.log_prefix_token, \
-                      nm_utils_syslog_to_str (level), \
-                      (long) getpid () \
-                      _NM_UTILS_MACRO_REST (__VA_ARGS__)); \
+             syslog (nm_utils_syslog_coerce_from_nm (level), \
+                     "nm-pptp[%s] %-7s [helper-%ld] " _NM_UTILS_MACRO_FIRST (__VA_ARGS__) "\n", \
+                     gl.log_prefix_token, \
+                     nm_utils_syslog_to_str (level), \
+                     (long) getpid () \
+                     _NM_UTILS_MACRO_REST (__VA_ARGS__)); \
          } \
     } G_STMT_END
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]