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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2196>
This commit is contained in:
Jonas Dreßler 2022-02-18 14:13:59 +01:00 committed by Marge Bot
parent 6c5a8d4ada
commit 8a1c7ce590

View File

@ -65,13 +65,12 @@ var ParentalControlsManager = GObject.registerClass({
async _initializeManager() {
if (!HAVE_MALCONTENT) {
log('Skipping parental controls support as its 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;
}