diff options
Diffstat (limited to 'shared/nm-glib-aux/nm-logging-fwd.h')
| -rw-r--r-- | shared/nm-glib-aux/nm-logging-fwd.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-logging-fwd.h b/shared/nm-glib-aux/nm-logging-fwd.h index 900dfff8..c60a20b5 100644 --- a/shared/nm-glib-aux/nm-logging-fwd.h +++ b/shared/nm-glib-aux/nm-logging-fwd.h @@ -110,4 +110,31 @@ void _nm_log_impl (const char *file, const char *fmt, ...) _nm_printf (10, 11); +static inline NMLogLevel +nm_log_level_from_syslog (int syslog_level) +{ + switch (syslog_level) { + case 0 /* LOG_EMERG */ : return LOGL_ERR; + case 1 /* LOG_ALERT */ : return LOGL_ERR; + case 2 /* LOG_CRIT */ : return LOGL_ERR; + case 3 /* LOG_ERR */ : return LOGL_ERR; + case 4 /* LOG_WARNING */ : return LOGL_WARN; + case 5 /* LOG_NOTICE */ : return LOGL_INFO; + case 6 /* LOG_INFO */ : return LOGL_DEBUG; + case 7 /* LOG_DEBUG */ : return LOGL_TRACE; + default: + return syslog_level >= 0 ? LOGL_TRACE : LOGL_ERR; + } +} + +/*****************************************************************************/ + +struct timespec; + +/* this function must be implemented to handle the notification when + * the first monotonic-timestamp is fetched. */ +extern void _nm_utils_monotonic_timestamp_initialized (const struct timespec *tp, + gint64 offset_sec, + gboolean is_boottime); + #endif /* __NM_LOGGING_DEFINES_H__ */ |