From 8a1c7ce5907ed076f7452f00cfc10947d7817bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 18 Feb 2022 14:13:59 +0100 Subject: [PATCH] parentalControlsManager: Be less verbose on the logs There's a few things that are really unncessary to log without any debugging enabled, for example "Getting parental controls for user", so remove that. Other things can be useful, so use console.debug() to log those. Especially the warning in showAppInfo() we don't want log by default as it spills tons of messages during shell startup (the async initialization of the malcontent manager takes some time). While at it, also make the !HAVE_MALCONTENT message a bit more accurate. Part-of: --- js/misc/parentalControlsManager.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/misc/parentalControlsManager.js b/js/misc/parentalControlsManager.js index 092721133..e2192caea 100644 --- a/js/misc/parentalControlsManager.js +++ b/js/misc/parentalControlsManager.js @@ -65,13 +65,12 @@ var ParentalControlsManager = GObject.registerClass({ async _initializeManager() { if (!HAVE_MALCONTENT) { - log('Skipping parental controls support as it’s disabled'); + console.debug('Skipping parental controls support, malcontent not found'); this._initialized = true; this.emit('app-filter-changed'); return; } - log(`Getting parental controls for user ${Shell.util_get_uid()}`); try { const connection = await Gio.DBus.get(Gio.BusType.SYSTEM, null); this._manager = new Malcontent.Manager({ connection }); @@ -81,7 +80,7 @@ var ParentalControlsManager = GObject.registerClass({ null); } catch (e) { if (e.matches(Malcontent.ManagerError, Malcontent.ManagerError.DISABLED)) { - log('Parental controls globally disabled'); + console.debug('Parental controls globally disabled'); this._disabled = true; } else { logError(e, 'Failed to get parental controls settings'); @@ -137,7 +136,7 @@ var ParentalControlsManager = GObject.registerClass({ // Have we finished initialising yet? if (!this.initialized) { - log(`Warning: Hiding app because parental controls not yet initialised: ${appInfo.get_id()}`); + console.debug(`Hiding app because parental controls not yet initialised: ${appInfo.get_id()}`); return false; }