1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-30 17:42:06 -04:00

logger: add a dedicated QML logging Singleton

- adds log.info/error/debug/warn/fatal
- adds ability to write logs to any file
- add CLI options in addition to env to set log levels
This commit is contained in:
bbedward
2026-04-29 15:40:44 -04:00
parent 3b96c6ab22
commit f76724f7cd
84 changed files with 1764 additions and 1297 deletions

View File

@@ -4,9 +4,11 @@ pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import qs.Common
import qs.Services
Singleton {
id: root
readonly property var log: Log.scoped("AppSearchService")
property var applications: []
property var _cachedCategories: null
@@ -811,7 +813,7 @@ Singleton {
});
isPersistent = false;
} catch (e) {
console.warn("AppSearchService: Error creating temporary plugin instance", pluginId, ":", e);
log.warn("Error creating temporary plugin instance", pluginId, ":", e);
return [];
}
}
@@ -831,7 +833,7 @@ Singleton {
instance.destroy();
}
} catch (e) {
console.warn("AppSearchService: Error getting items from plugin", pluginId, ":", e);
log.warn("Error getting items from plugin", pluginId, ":", e);
if (!isPersistent)
instance.destroy();
}
@@ -857,7 +859,7 @@ Singleton {
});
isPersistent = false;
} catch (e) {
console.warn("AppSearchService: Error creating temporary plugin instance for execution", pluginId, ":", e);
log.warn("Error creating temporary plugin instance for execution", pluginId, ":", e);
return false;
}
}
@@ -877,7 +879,7 @@ Singleton {
instance.destroy();
}
} catch (e) {
console.warn("AppSearchService: Error executing item from plugin", pluginId, ":", e);
log.warn("Error executing item from plugin", pluginId, ":", e);
if (!isPersistent)
instance.destroy();
}
@@ -949,7 +951,7 @@ Singleton {
try {
return instance.getCategories() || [];
} catch (e) {
console.warn("AppSearchService: Error getting categories from plugin", pluginId, ":", e);
log.warn("Error getting categories from plugin", pluginId, ":", e);
return [];
}
}
@@ -968,7 +970,7 @@ Singleton {
try {
instance.setCategory(categoryId);
} catch (e) {
console.warn("AppSearchService: Error setting category on plugin", pluginId, ":", e);
log.warn("Error setting category on plugin", pluginId, ":", e);
}
}