about summary refs log tree commit diff
path: root/shared/nm-glib-aux/nm-logging-base.h
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2020-01-13 16:10:30 +0100
committerSebastien Bacher <seb128@ubuntu.com>2020-01-13 16:31:40 +0100
commit5a09f7759860f4f2a9bb01471ca8099cd705bc10 (patch)
tree3a9cffc9622d53c9196771a1c7924bceb754f118 /shared/nm-glib-aux/nm-logging-base.h
parent25691220fd27093630cf244e219b2f4f1f4e749e (diff)
parentca847639aab94434daed120c874e1100c3d75dcf (diff)
Merge remote-tracking branch 'salsa/debian/master'
Diffstat (limited to 'shared/nm-glib-aux/nm-logging-base.h')
-rw-r--r--shared/nm-glib-aux/nm-logging-base.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-logging-base.h b/shared/nm-glib-aux/nm-logging-base.h
new file mode 100644
index 00000000..3d964a6e
--- /dev/null
+++ b/shared/nm-glib-aux/nm-logging-base.h
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: LGPL-2.1+
+
+#ifndef __NM_LOGGING_BASE_H__
+#define __NM_LOGGING_BASE_H__
+
+#include "nm-logging-fwd.h"
+
+typedef struct {
+	const char *name;
+	const char *level_str;
+
+	/* nm-logging uses syslog internally. Note that the three most-verbose syslog levels
+	 * are LOG_DEBUG, LOG_INFO and LOG_NOTICE. Journal already highlights LOG_NOTICE
+	 * as special.
+	 *
+	 * On the other hand, we have three levels LOGL_TRACE, LOGL_DEBUG and LOGL_INFO,
+	 * which are regular messages not to be highlighted. For that reason, we must map
+	 * LOGL_TRACE and LOGL_DEBUG both to syslog level LOG_DEBUG. */
+	int syslog_level;
+
+	GLogLevelFlags g_log_level;
+} LogLevelDesc;
+
+extern const LogLevelDesc level_desc[_LOGL_N];
+
+gboolean _nm_log_parse_level (const char *level,
+                              NMLogLevel *out_level);
+
+#endif /* __NM_LOGGING_BASE_H__ */