[tracker/wip/carlosg/domain-ontologies: 33/93] libtracker-sparql: Do not modify messages verbosity
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/domain-ontologies: 33/93] libtracker-sparql: Do not modify messages verbosity
- Date: Mon, 19 Jun 2017 23:02:59 +0000 (UTC)
commit 36b6c363de2ffb8dcfeacce4e469a7519ae926bb
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Jun 4 19:26:24 2017 +0200
libtracker-sparql: Do not modify messages verbosity
This is a library, G_MESSAGES_DEBUG is just not ours. The TRACKER_VERBOSITY
envvar still affects all tracker executables, but users will need to manually
set G_MESSAGES_DEBUG if they want to catch tracker debugging from an app linking
to it.
src/libtracker-sparql-backend/tracker-backend.vala | 57 --------------------
1 files changed, 0 insertions(+), 57 deletions(-)
---
diff --git a/src/libtracker-sparql-backend/tracker-backend.vala
b/src/libtracker-sparql-backend/tracker-backend.vala
index 8d3c7db..3036cf9 100644
--- a/src/libtracker-sparql-backend/tracker-backend.vala
+++ b/src/libtracker-sparql-backend/tracker-backend.vala
@@ -202,7 +202,6 @@ class Tracker.Sparql.Backend : Connection {
}
static weak Connection? singleton;
- static bool log_initialized;
static Mutex door;
static new Connection get (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError,
SpawnError {
@@ -213,8 +212,6 @@ class Tracker.Sparql.Backend : Connection {
var result = singleton;
if (result == null) {
- log_init ();
-
result = new Tracker.Sparql.Backend ();
if (cancellable != null && cancellable.is_cancelled ()) {
@@ -312,60 +309,6 @@ class Tracker.Sparql.Backend : Connection {
return result;
}
}
-
- private static void log_init () {
- if (log_initialized) {
- return;
- }
-
- log_initialized = true;
-
- // Avoid debug messages
- int verbosity = 0;
- string env_verbosity = Environment.get_variable ("TRACKER_VERBOSITY");
- if (env_verbosity != null)
- verbosity = int.parse (env_verbosity);
-
- LogLevelFlags remove_levels = 0;
-
- // If we have debug enabled, we imply G_MESSAGES_DEBUG or we
- // see nothing, this came in since GLib 2.32.
- if (verbosity > 2)
- Environment.set_variable ("G_MESSAGES_DEBUG", "all", true);
-
- switch (verbosity) {
- // Log level 3: EVERYTHING
- case 3:
- break;
-
- // Log level 2: CRITICAL/ERROR/WARNING/INFO/MESSAGE only
- case 2:
- remove_levels = LogLevelFlags.LEVEL_DEBUG;
- break;
-
- // Log level 1: CRITICAL/ERROR/WARNING/INFO only
- case 1:
- remove_levels = LogLevelFlags.LEVEL_DEBUG |
- LogLevelFlags.LEVEL_MESSAGE;
- break;
-
- // Log level 0: CRITICAL/ERROR/WARNING only (default)
- default:
- case 0:
- remove_levels = LogLevelFlags.LEVEL_DEBUG |
- LogLevelFlags.LEVEL_MESSAGE |
- LogLevelFlags.LEVEL_INFO;
- break;
- }
-
- if (remove_levels != 0) {
- GLib.Log.set_handler ("Tracker", remove_levels, remove_log_handler);
- }
- }
-
- private static void remove_log_handler (string? log_domain, LogLevelFlags log_level, string message) {
- /* do nothing */
- }
}
public async static Tracker.Sparql.Connection tracker_sparql_connection_get_async (Cancellable? cancellable
= null) throws Tracker.Sparql.Error, IOError, DBusError, SpawnError {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]