diff options
author | Thomas Haller <thaller@redhat.com> | 2021-07-21 13:08:56 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-07-23 16:43:37 +0200 |
commit | 6c030ed923815b4d2fa97c7d604c897cc4702e20 (patch) | |
tree | 256e0a94d5e736623754c9904a4eb08b1b0a984c /src/nm-cloud-setup | |
parent | 32b2d150217515201b5a5576aceb3f10ea03c33f (diff) | |
download | NetworkManager-6c030ed923815b4d2fa97c7d604c897cc4702e20.tar.gz |
glib-aux,cloud-setup: add _nm_logging_enabled*() helper API
Will also be used outside of nm-cloud-setup.
Diffstat (limited to 'src/nm-cloud-setup')
-rw-r--r-- | src/nm-cloud-setup/nm-cloud-setup-utils.c | 17 | ||||
-rw-r--r-- | src/nm-cloud-setup/nm-cloud-setup-utils.h | 12 |
2 files changed, 1 insertions, 28 deletions
diff --git a/src/nm-cloud-setup/nm-cloud-setup-utils.c b/src/nm-cloud-setup/nm-cloud-setup-utils.c index 50720ba26f..206461e4d0 100644 --- a/src/nm-cloud-setup/nm-cloud-setup-utils.c +++ b/src/nm-cloud-setup/nm-cloud-setup-utils.c @@ -13,23 +13,6 @@ /*****************************************************************************/ -volatile NMLogLevel _nm_logging_configured_level = LOGL_TRACE; - -void -_nm_logging_enabled_init(const char *level_str) -{ - NMLogLevel level; - - if (!_nm_log_parse_level(level_str, &level)) - level = LOGL_WARN; - else if (level == _LOGL_KEEP) - level = LOGL_WARN; - - _nm_logging_configured_level = level; -} - -/*****************************************************************************/ - G_LOCK_DEFINE_STATIC(_wait_for_objects_lock); static GSList *_wait_for_objects_list; static GSList *_wait_for_objects_iterate_loops; diff --git a/src/nm-cloud-setup/nm-cloud-setup-utils.h b/src/nm-cloud-setup/nm-cloud-setup-utils.h index e980afbe40..e1502b9525 100644 --- a/src/nm-cloud-setup/nm-cloud-setup-utils.h +++ b/src/nm-cloud-setup/nm-cloud-setup-utils.h @@ -13,16 +13,6 @@ /*****************************************************************************/ -extern volatile NMLogLevel _nm_logging_configured_level; - -static inline gboolean -nm_logging_enabled(NMLogLevel level) -{ - return level >= _nm_logging_configured_level; -} - -void _nm_logging_enabled_init(const char *level_str); - #define _nm_log(level, ...) _nm_log_simple_printf((level), __VA_ARGS__); #define _NMLOG(level, ...) \ @@ -30,7 +20,7 @@ void _nm_logging_enabled_init(const char *level_str); { \ const NMLogLevel _level = (level); \ \ - if (nm_logging_enabled(_level)) { \ + if (_nm_logging_enabled(_level)) { \ _nm_log(_level, __VA_ARGS__); \ } \ } \ |