diff options
author | Richard Hughes <richard@hughsie.com> | 2010-11-01 11:28:31 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2010-11-01 11:28:31 +0000 |
commit | 59893663fbc0b9b5951b69b99a849d4ae5a2f3fd (patch) | |
tree | 095c1acca94e25920a64635b849d4de654c1d984 /src/up-main.c | |
parent | ed34986e08fc45e5337c3edae181c3caa23c99d2 (diff) |
Port from EggDebug to the GLib built-in logging framework
Diffstat (limited to 'src/up-main.c')
-rw-r--r-- | src/up-main.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/up-main.c b/src/up-main.c index 9f2cb24..d116487 100644 --- a/src/up-main.c +++ b/src/up-main.c @@ -36,8 +36,6 @@ #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-lowlevel.h> -#include "egg-debug.h" - #include "up-daemon.h" #include "up-qos.h" #include "up-kbd-backlight.h" @@ -67,10 +65,10 @@ up_main_acquire_name_on_proxy (DBusGProxy *bus_proxy, const gchar *name) G_TYPE_INVALID); if (!ret) { if (error != NULL) { - egg_warning ("Failed to acquire %s: %s", name, error->message); + g_warning ("Failed to acquire %s: %s", name, error->message); g_error_free (error); } else { - egg_warning ("Failed to acquire %s", name); + g_warning ("Failed to acquire %s", name); } goto out; } @@ -78,10 +76,10 @@ up_main_acquire_name_on_proxy (DBusGProxy *bus_proxy, const gchar *name) /* already taken */ if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { if (error != NULL) { - egg_warning ("Failed to acquire %s: %s", name, error->message); + g_warning ("Failed to acquire %s: %s", name, error->message); g_error_free (error); } else { - egg_warning ("Failed to acquire %s", name); + g_warning ("Failed to acquire %s", name); } ret = FALSE; goto out; @@ -96,7 +94,7 @@ out: static void up_main_sigint_handler (gint sig) { - egg_debug ("Handling SIGINT"); + g_debug ("Handling SIGINT"); /* restore default */ signal (SIGINT, SIG_DFL); @@ -151,14 +149,13 @@ main (gint argc, gchar **argv) context = g_option_context_new ("upower daemon"); g_option_context_add_main_entries (context, options, NULL); - g_option_context_add_group (context, egg_debug_get_option_group ()); g_option_context_parse (context, &argc, &argv, NULL); g_option_context_free (context); /* get bus connection */ bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); if (bus == NULL) { - egg_warning ("Couldn't connect to system bus: %s", error->message); + g_warning ("Couldn't connect to system bus: %s", error->message); g_error_free (error); goto out; } @@ -167,21 +164,21 @@ main (gint argc, gchar **argv) bus_proxy = dbus_g_proxy_new_for_name (bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); if (bus_proxy == NULL) { - egg_warning ("Could not construct bus_proxy object; bailing out"); + g_warning ("Could not construct bus_proxy object; bailing out"); goto out; } /* aquire name */ ret = up_main_acquire_name_on_proxy (bus_proxy, DEVKIT_POWER_SERVICE_NAME); if (!ret) { - egg_warning ("Could not acquire name; bailing out"); + g_warning ("Could not acquire name; bailing out"); goto out; } /* do stuff on ctrl-c */ signal (SIGINT, up_main_sigint_handler); - egg_debug ("Starting upowerd version %s", PACKAGE_VERSION); + g_debug ("Starting upowerd version %s", PACKAGE_VERSION); qos = up_qos_new (); kbd_backlight = up_kbd_backlight_new (); @@ -190,7 +187,7 @@ main (gint argc, gchar **argv) loop = g_main_loop_new (NULL, FALSE); ret = up_daemon_startup (daemon); if (!ret) { - egg_warning ("Could not startup; bailing out"); + g_warning ("Could not startup; bailing out"); goto out; } |