mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-20 08:31:47 +00:00
core/logging: return static string from nm_logging_level_to_string()
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
ff6946a193
commit
85b972e9b8
|
@ -263,10 +263,10 @@ nm_logging_setup (const char *level,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
nm_logging_level_to_string (void)
|
||||
{
|
||||
return g_strdup (level_names[log_level]);
|
||||
return level_names[log_level];
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
|
@ -114,7 +114,7 @@ void _nm_log (const char *loc,
|
|||
const char *fmt,
|
||||
...) __attribute__((__format__ (__printf__, 5, 6)));
|
||||
|
||||
char *nm_logging_level_to_string (void);
|
||||
const char *nm_logging_level_to_string (void);
|
||||
char *nm_logging_domains_to_string (void);
|
||||
gboolean nm_logging_enabled (guint32 level, guint64 domain);
|
||||
|
||||
|
|
|
@ -4089,12 +4089,10 @@ impl_manager_set_logging (NMManager *manager,
|
|||
}
|
||||
|
||||
if (nm_logging_setup (level, domains, NULL, &error)) {
|
||||
char *new_level = nm_logging_level_to_string ();
|
||||
char *new_domains = nm_logging_domains_to_string ();
|
||||
|
||||
nm_log_info (LOGD_CORE, "logging: level '%s' domains '%s'",
|
||||
new_level, new_domains);
|
||||
g_free (new_level);
|
||||
nm_logging_level_to_string (), new_domains);
|
||||
g_free (new_domains);
|
||||
}
|
||||
|
||||
|
@ -4111,7 +4109,7 @@ impl_manager_get_logging (NMManager *manager,
|
|||
char **level,
|
||||
char **domains)
|
||||
{
|
||||
*level = nm_logging_level_to_string ();
|
||||
*level = g_strdup (nm_logging_level_to_string ());
|
||||
*domains = nm_logging_domains_to_string ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue