logging: add new logging level "TRACE"
authorThomas Haller <thaller@redhat.com>
Mon, 14 Apr 2014 12:26:13 +0000 (14:26 +0200)
committerThomas Haller <thaller@redhat.com>
Sun, 5 Oct 2014 16:24:36 +0000 (18:24 +0200)
Signed-off-by: Thomas Haller <thaller@redhat.com>
introspection/nm-manager.xml
man/NetworkManager.conf.xml.in
po/el.po
po/en_GB.po
po/eo.po
po/gl.po
po/id.po
po/sl.po
po/tr.po
src/nm-logging.c
src/nm-logging.h

index 78021f7..ac9bec6 100644 (file)
       </tp:docstring>
       <arg name="level" type="s" direction="in">
         <tp:docstring>
-          One of [ERR, WARN, INFO, DEBUG].
+          One of [ERR, WARN, INFO, DEBUG, TRACE].
         </tp:docstring>
       </arg>
       <arg name="domains" type="s" direction="in">
       </tp:docstring>
       <arg name="level" type="s" direction="out">
         <tp:docstring>
-          One of [ERR, WARN, INFO, DEBUG].
+          One of [ERR, WARN, INFO, DEBUG, TRACE].
         </tp:docstring>
       </arg>
       <arg name="domains" type="s" direction="out">
index 06aa403..fcb4dfc 100644 (file)
@@ -316,11 +316,12 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth
          <listitem><para>The default logging verbosity level.
          One of <literal>ERR</literal>,
          <literal>WARN</literal>, <literal>INFO</literal>,
-         <literal>DEBUG</literal>.  The ERR level logs only critical
-         errors.  WARN logs warnings that may reflect operation.
-         INFO logs various informational messages that are useful for
-         tracking state and operations.  DEBUG enables verbose
-         logging for debugging purposes.  Subsequent levels also log
+         <literal>DEBUG</literal>, <literal>TRACE</literal>.  The ERR
+         level logs only critical errors.  WARN logs warnings that may
+         reflect operation. INFO logs various informational messages that
+         are useful for tracking state and operations.  DEBUG enables
+         verbose logging for debugging purposes. TRACE enables even more
+         verbose logging then DEBUG level.  Subsequent levels also log
          all messages from earlier levels; thus setting the log level
          to INFO also logs error and warning messages.</para></listitem>
        </varlistentry>
index db8cf54..fffbd31 100644 (file)
--- a/po/el.po
+++ b/po/el.po
@@ -2532,8 +2532,8 @@ msgstr "plugin1,plugin2"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:384
-msgid "Log level: one of [ERR, WARN, INFO, DEBUG]"
-msgstr "Επίπεδο καταγραφής: ένα από τα [ERR, WARN, INFO, DEBUG]"
+msgid "Log level: one of [ERR, WARN, INFO, DEBUG, TRACE]"
+msgstr "Επίπεδο καταγραφής: ένα από τα [ERR, WARN, INFO, DEBUG, TRACE]"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:387
index 3997ed5..f1dea3f 100644 (file)
@@ -2469,8 +2469,8 @@ msgstr "plugin1,plugin2"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:384
-msgid "Log level: one of [ERR, WARN, INFO, DEBUG]"
-msgstr "Log level: one of [ERR, WARN, INFO, DEBUG]"
+msgid "Log level: one of [ERR, WARN, INFO, DEBUG, TRACE]"
+msgstr "Log level: one of [ERR, WARN, INFO, DEBUG, TRACE]"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:387
index c466a5d..51fceb9 100644 (file)
--- a/po/eo.po
+++ b/po/eo.po
@@ -2321,7 +2321,7 @@ msgstr ""
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:376
-msgid "Log level: one of [ERR, WARN, INFO, DEBUG]"
+msgid "Log level: one of [ERR, WARN, INFO, DEBUG, TRACE]"
 msgstr ""
 
 #. Translators: Do not translate the values in the square brackets
index 5dc613d..f2a6d89 100644 (file)
--- a/po/gl.po
+++ b/po/gl.po
@@ -2608,8 +2608,8 @@ msgstr "engadido1,engadido2"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:371
-msgid "Log level: one of [ERR, WARN, INFO, DEBUG]"
-msgstr "Nivel de rexistroÑ un de [ERR, WARN, INFO, DEBUG]"
+msgid "Log level: one of [ERR, WARN, INFO, DEBUG, TRACE]"
+msgstr "Nivel de rexistroÑ un de [ERR, WARN, INFO, DEBUG, TRACE]"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:374
index 0288338..67ed28e 100644 (file)
--- a/po/id.po
+++ b/po/id.po
@@ -2463,8 +2463,8 @@ msgstr "plugin1,plugin2"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:384
-msgid "Log level: one of [ERR, WARN, INFO, DEBUG]"
-msgstr "Aras log: satu dari [ERR, WARN, INFO, DEBUG]"
+msgid "Log level: one of [ERR, WARN, INFO, DEBUG, TRACE]"
+msgstr "Aras log: satu dari [ERR, WARN, INFO, DEBUG, TRACE]"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:387
index ddd4e08..3cad67f 100644 (file)
--- a/po/sl.po
+++ b/po/sl.po
@@ -2593,8 +2593,8 @@ msgstr "vstavek1,vstavek2"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:383
-msgid "Log level: one of [ERR, WARN, INFO, DEBUG]"
-msgstr "Raven beleženja: ena izmed [ERR, WARN, INFO, DEBUG]"
+msgid "Log level: one of [ERR, WARN, INFO, DEBUG, TRACE]"
+msgstr "Raven beleženja: ena izmed [ERR, WARN, INFO, DEBUG, TRACE]"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:386
index 713163b..f15b3c1 100644 (file)
--- a/po/tr.po
+++ b/po/tr.po
@@ -2935,7 +2935,7 @@ msgstr "eklenti1,eklenti2"
 
 #. Translators: Do not translate the values in the square brackets
 #: ../src/main.c:336
-msgid "Log level: one of [ERR, WARN, INFO, DEBUG]"
+msgid "Log level: one of [ERR, WARN, INFO, DEBUG, TRACE]"
 msgstr ""
 
 #. Translators: Do not translate the values in the square brackets
index c8deee0..70d5304 100644 (file)
@@ -68,6 +68,7 @@ typedef struct {
 } LogDesc;
 
 static const char *level_names[LOGL_MAX] = {
+       [LOGL_TRACE] = "TRACE",
        [LOGL_DEBUG] = "DEBUG",
        [LOGL_INFO] = "INFO",
        [LOGL_WARN] = "WARN",
@@ -405,6 +406,12 @@ _nm_log (const char *loc,
        va_end (args);
 
        switch (level) {
+       case LOGL_TRACE:
+               g_get_current_time (&tv);
+               syslog_level = LOG_DEBUG;
+               g_log_level = G_LOG_LEVEL_DEBUG;
+               fullmsg = g_strdup_printf ("<trace> [%ld.%06ld] [%s] %s(): %s", tv.tv_sec, tv.tv_usec, loc, func, msg);
+               break;
        case LOGL_DEBUG:
                g_get_current_time (&tv);
                syslog_level = LOG_INFO;
index 2158ec0..4239a20 100644 (file)
@@ -77,6 +77,7 @@ enum {
 
 /* Log levels */
 enum {
+       LOGL_TRACE,
        LOGL_DEBUG,
        LOGL_INFO,
        LOGL_WARN,
@@ -98,6 +99,7 @@ GQuark nm_logging_error_quark    (void);
 #define nm_log_warn(domain, ...)    nm_log (LOGL_WARN,  (domain), __VA_ARGS__)
 #define nm_log_info(domain, ...)    nm_log (LOGL_INFO,  (domain), __VA_ARGS__)
 #define nm_log_dbg(domain, ...)     nm_log (LOGL_DEBUG, (domain), __VA_ARGS__)
+#define nm_log_trace(domain, ...)   nm_log (LOGL_TRACE, (domain), __VA_ARGS__)
 
 /* nm_log() only evaluates it's argument list after checking
  * whether logging for the given level/domain is enabled.  */