summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libnm-core/nm-errors.h4
-rw-r--r--src/nm-logging.c17
-rw-r--r--src/nm-logging.h9
-rw-r--r--src/nm-manager.c1
4 files changed, 7 insertions, 24 deletions
diff --git a/libnm-core/nm-errors.h b/libnm-core/nm-errors.h
index 7a2e5ba0f1..23df500413 100644
--- a/libnm-core/nm-errors.h
+++ b/libnm-core/nm-errors.h
@@ -149,6 +149,8 @@ GQuark nm_device_error_quark (void);
* sleep/wake state.
* @NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED: The network is already
* enabled/disabled.
+ * @NM_MANAGER_ERROR_UNKNOWN_LOG_LEVEL: Unknown log level in SetLogging
+ * @NM_MANAGER_ERROR_UNKNOWN_LOG_DOMAIN: Unknown log domain in SetLogging
*
* Errors related to the main "network management" interface of NetworkManager.
* These may be returned from #NMClient methods that invoke D-Bus operations on
@@ -166,6 +168,8 @@ typedef enum {
NM_MANAGER_ERROR_DEPENDENCY_FAILED, /*< nick=DependencyFailed >*/
NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE, /*< nick=AlreadyAsleepOrAwake >*/
NM_MANAGER_ERROR_ALREADY_ENABLED_OR_DISABLED, /*< nick=AlreadyEnabledOrDisabled >*/
+ NM_MANAGER_ERROR_UNKNOWN_LOG_LEVEL, /*< nick=UnknownLogLevel >*/
+ NM_MANAGER_ERROR_UNKNOWN_LOG_DOMAIN, /*< nick=UnknownLogDomain >*/
} NMManagerError;
GQuark nm_manager_error_quark (void);
diff --git a/src/nm-logging.c b/src/nm-logging.c
index 70d5304891..9dbc9f2618 100644
--- a/src/nm-logging.c
+++ b/src/nm-logging.c
@@ -36,6 +36,7 @@
#include "nm-glib-compat.h"
#include "nm-logging.h"
+#include "nm-errors.h"
static void
nm_log_handler (const gchar *log_domain,
@@ -123,18 +124,6 @@ static const LogDesc domain_descs[] = {
/************************************************************************/
-GQuark
-nm_logging_error_quark (void)
-{
- static GQuark ret = 0;
-
- if (ret == 0)
- ret = g_quark_from_static_string ("nm_logging_error");
- return ret;
-}
-
-/************************************************************************/
-
static void
_ensure_initialized ()
{
@@ -156,7 +145,7 @@ match_log_level (const char *level,
}
}
- g_set_error (error, NM_LOGGING_ERROR, NM_LOGGING_ERROR_UNKNOWN_LEVEL,
+ g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_LOG_LEVEL,
_("Unknown log level '%s'"), level);
return FALSE;
}
@@ -238,7 +227,7 @@ nm_logging_setup (const char *level,
if (!bits) {
if (!bad_domains) {
- g_set_error (error, NM_LOGGING_ERROR, NM_LOGGING_ERROR_UNKNOWN_DOMAIN,
+ g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_UNKNOWN_LOG_DOMAIN,
_("Unknown log domain '%s'"), *iter);
return FALSE;
}
diff --git a/src/nm-logging.h b/src/nm-logging.h
index 4239a20dda..d50ca8cbd0 100644
--- a/src/nm-logging.h
+++ b/src/nm-logging.h
@@ -86,15 +86,6 @@ enum {
LOGL_MAX
};
-typedef enum {
- NM_LOGGING_ERROR_UNKNOWN_LEVEL = 0, /*< nick=UnknownLevel >*/
- NM_LOGGING_ERROR_UNKNOWN_DOMAIN = 1, /*< nick=UnknownDomain >*/
-} NMLoggingError;
-
-#define NM_LOGGING_ERROR (nm_logging_error_quark ())
-GQuark nm_logging_error_quark (void);
-
-
#define nm_log_err(domain, ...) nm_log (LOGL_ERR, (domain), __VA_ARGS__)
#define nm_log_warn(domain, ...) nm_log (LOGL_WARN, (domain), __VA_ARGS__)
#define nm_log_info(domain, ...) nm_log (LOGL_INFO, (domain), __VA_ARGS__)
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 86777ea435..aa2224484e 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -5250,6 +5250,5 @@ nm_manager_class_init (NMManagerClass *manager_class)
&dbus_glib_nm_manager_object_info);
dbus_g_error_domain_register (NM_MANAGER_ERROR, NM_DBUS_INTERFACE, NM_TYPE_MANAGER_ERROR);
- dbus_g_error_domain_register (NM_LOGGING_ERROR, "org.freedesktop.NetworkManager.Logging", NM_TYPE_LOGGING_ERROR);
}