diff options
author | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2022-10-07 16:39:44 +0200 |
---|---|---|
committer | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2022-10-11 14:51:36 +0200 |
commit | dc90a358e8410c8f4a631aca2167e2b24f46af9c (patch) | |
tree | 5db6a21b88d76b55a5bcdc8782a183a09815fc80 /src/gclue-locator.c | |
parent | 3610c139deeffa8db5144f08430d5b33151cd0a9 (diff) | |
download | geoclue-dc90a358e8410c8f4a631aca2167e2b24f46af9c.tar.gz |
Make debug messages more specific which location source they pertain
And consolidate duplicate ones.
Diffstat (limited to 'src/gclue-locator.c')
-rw-r--r-- | src/gclue-locator.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gclue-locator.c b/src/gclue-locator.c index a7dd890..d9e8cdc 100644 --- a/src/gclue-locator.c +++ b/src/gclue-locator.c @@ -81,15 +81,14 @@ static GParamSpec *gParamSpecs[LAST_PROP]; static void set_location (GClueLocator *locator, - GClueLocation *location) + GClueLocation *location, + const char *src_name) { GClueLocation *cur_location; cur_location = gclue_location_source_get_location (GCLUE_LOCATION_SOURCE (locator)); - g_debug ("New location available"); - if (cur_location != NULL) { guint64 cur_timestamp, new_timestamp; double dist, speed; @@ -97,7 +96,8 @@ set_location (GClueLocator *locator, cur_timestamp = gclue_location_get_timestamp (cur_location); new_timestamp = gclue_location_get_timestamp (location); if (new_timestamp < cur_timestamp) { - g_debug ("New location older than current, ignoring."); + g_debug ("New %s location older than current, ignoring.", + src_name); return; } @@ -126,11 +126,12 @@ set_location (GClueLocator *locator, * a reasonable speed, OR it is more or as accurate as * the previous one. */ - g_debug ("Ignoring less accurate new location"); + g_debug ("Ignoring less accurate new %s location", src_name); return; } } + g_debug ("New location available from %s", src_name); gclue_location_source_set_location (GCLUE_LOCATION_SOURCE (locator), location); } @@ -183,7 +184,7 @@ on_location_changed (GObject *gobject, GClueLocation *location; location = gclue_location_source_get_location (source); - set_location (locator, location); + set_location (locator, location, G_OBJECT_TYPE_NAME (source)); } static gboolean @@ -206,7 +207,7 @@ start_source (GClueLocator *locator, location = gclue_location_source_get_location (src); if (gclue_location_source_get_active (src) && location != NULL) - set_location (locator, location); + set_location (locator, location, G_OBJECT_TYPE_NAME (src)); gclue_location_source_start (src); } |