1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

meta: log level re-work

This commit is contained in:
bbedward
2025-10-23 16:13:27 -04:00
parent d5c4b990dc
commit 0c7af9c740
23 changed files with 61 additions and 93 deletions

View File

@@ -67,7 +67,7 @@ Singleton {
}
function migrateFromUndefinedToV1(cache) {
console.log("CacheData: Migrating configuration from undefined to version 1")
console.info("CacheData: Migrating configuration from undefined to version 1")
}
function cleanupUnusedKeys() {
@@ -115,7 +115,7 @@ Singleton {
}
onLoadFailed: error => {
if (!isGreeterMode) {
console.log("CacheData: No cache file found, starting fresh")
console.info("CacheData: No cache file found, starting fresh")
}
}
}

View File

@@ -43,7 +43,7 @@ Singleton {
try {
root.translations = JSON.parse(text())
root.translationsLoaded = true
console.log(`I18n: Loaded translations for '${root.currentLocale}' ` +
console.info(`I18n: Loaded translations for '${root.currentLocale}' ` +
`(${Object.keys(root.translations).length} contexts)`)
} catch (e) {
console.warn(`I18n: Error parsing '${root.currentLocale}':`, e,
@@ -84,7 +84,7 @@ Singleton {
_selectedPath = fileUrl
translationsLoaded = false
translations = ({})
console.log(`I18n: Using locale '${localeTag}' from ${fileUrl}`)
console.info(`I18n: Using locale '${localeTag}' from ${fileUrl}`)
}
function _fallbackToEnglish() {

View File

@@ -196,7 +196,7 @@ Singleton {
}
function migrateFromUndefinedToV1(settings) {
console.log("SessionData: Migrating configuration from undefined to version 1")
console.info("SessionData: Migrating configuration from undefined to version 1")
if (typeof SettingsData !== "undefined") {
if (settings.acMonitorTimeout !== undefined) {
SettingsData.setAcMonitorTimeout(settings.acMonitorTimeout)
@@ -707,7 +707,7 @@ Singleton {
running: false
onExited: exitCode => {
if (exitCode === 0) {
console.log("Copied default-session.json to session.json")
console.info("Copied default-session.json to session.json")
settingsFile.reload()
}
}

View File

@@ -321,7 +321,7 @@ Singleton {
} else if (settings.themeIndex >= 0 && settings.themeIndex < themeNames.length) {
currentThemeName = themeNames[settings.themeIndex]
}
console.log("Auto-migrated theme from index", settings.themeIndex, "to", currentThemeName)
console.info("Auto-migrated theme from index", settings.themeIndex, "to", currentThemeName)
} else {
currentThemeName = settings.currentThemeName !== undefined ? settings.currentThemeName : "blue"
}
@@ -705,7 +705,7 @@ Singleton {
}
function migrateFromUndefinedToV1(settings) {
console.log("SettingsData: Migrating configuration from undefined to version 1")
console.info("SettingsData: Migrating configuration from undefined to version 1")
}
function cleanupUnusedKeys() {
@@ -2024,7 +2024,7 @@ Singleton {
running: false
onExited: exitCode => {
if (exitCode === 0) {
console.log("Copied default-settings.json to settings.json")
console.info("Copied default-settings.json to settings.json")
settingsFile.reload()
} else {
applyStoredTheme()

View File

@@ -92,7 +92,7 @@ Singleton {
}
if (colorsFileLoadFailed && currentTheme === dynamic && wallpaperPath) {
console.log("Theme: Matugen now available, regenerating colors for dynamic theme")
console.info("Theme: Matugen now available, regenerating colors for dynamic theme")
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
@@ -701,7 +701,7 @@ Singleton {
return
}
console.log("Theme: Setting desired theme -", kind, "mode:", isLight ? "light" : "dark", "type:", matugenType)
console.info("Theme: Setting desired theme -", kind, "mode:", isLight ? "light" : "dark", "type:", matugenType)
if (typeof NiriService !== "undefined" && CompositorService.isNiri) {
NiriService.suppressNextToast()
@@ -908,7 +908,7 @@ Singleton {
workerRunning = false
if (exitCode === 0) {
console.log("Theme: Matugen worker completed successfully")
console.info("Theme: Matugen worker completed successfully")
if (currentTheme === dynamic) {
console.log("Theme: Reloading dynamic colors file")
dynamicColorsFileView.reload()
@@ -983,7 +983,7 @@ Singleton {
onLoaded: {
if (currentTheme === dynamic) {
console.log("Theme: Dynamic colors file loaded successfully")
console.info("Theme: Dynamic colors file loaded successfully")
colorsFileLoadFailed = false
parseAndLoadColors()
}
@@ -997,7 +997,7 @@ Singleton {
onLoadFailed: function (error) {
if (currentTheme === dynamic) {
console.log("Theme: Dynamic colors file load failed, marking for regeneration")
console.warn("Theme: Dynamic colors file load failed, marking for regeneration")
colorsFileLoadFailed = true
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
if (!isGreeterMode && matugenAvailable && wallpaperPath) {

View File

@@ -46,7 +46,7 @@ Item {
item.popoutService = PopoutService
}
item.pluginId = pluginId
console.log("Daemon plugin loaded:", pluginId)
console.info("Daemon plugin loaded:", pluginId)
}
}
}

View File

@@ -235,11 +235,11 @@ Item {
Connections {
target: PluginService
function onPluginLoaded(pluginId) {
console.log("DankBar: Plugin loaded:", pluginId)
console.info("DankBar: Plugin loaded:", pluginId)
SettingsData.widgetDataChanged()
}
function onPluginUnloaded(pluginId) {
console.log("DankBar: Plugin unloaded:", pluginId)
console.info("DankBar: Plugin unloaded:", pluginId)
SettingsData.widgetDataChanged()
}
}

View File

@@ -18,7 +18,7 @@ Item {
keyboard.target = keyboard_controller.target;
isKeyboardActive = true;
} else
console.info("The keyboard is already shown");
console.log("The keyboard is already shown");
}
function hide() {
@@ -26,7 +26,7 @@ Item {
keyboard.destroy();
isKeyboardActive = false;
} else
console.info("The keyboard is already hidden");
console.log("The keyboard is already hidden");
}
// private

View File

@@ -13,7 +13,7 @@ Item {
signal itemsChanged()
Component.onCompleted: {
console.log("LauncherExample: Plugin loaded")
console.info("LauncherExample: Plugin loaded")
// Load custom trigger from settings
if (pluginService) {

View File

@@ -57,10 +57,10 @@ PluginComponent {
}
Component.onCompleted: {
console.log("WallpaperWatcherDaemon: Started monitoring wallpaper changes")
console.info("WallpaperWatcherDaemon: Started monitoring wallpaper changes")
}
Component.onDestruction: {
console.log("WallpaperWatcherDaemon: Stopped monitoring wallpaper changes")
console.info("WallpaperWatcherDaemon: Stopped monitoring wallpaper changes")
}
}

View File

@@ -573,7 +573,7 @@ Singleton {
if (!detectSoundsAvailability()) {
console.warn("AudioService: QtMultimedia not available - sound effects disabled")
} else {
console.log("AudioService: Sound effects enabled")
console.info("AudioService: Sound effects enabled")
checkGsettings()
Qt.callLater(createSoundPlayers)
}

View File

@@ -328,7 +328,7 @@ Singleton {
isHyprland = true
isNiri = false
compositor = "hyprland"
console.log("CompositorService: Detected Hyprland")
console.info("CompositorService: Detected Hyprland")
try {
Hyprland.refreshToplevels()
} catch(e) {}
@@ -341,7 +341,7 @@ Singleton {
isNiri = true
isHyprland = false
compositor = "niri"
console.log("CompositorService: Detected Niri with socket:", niriSocket)
console.info("CompositorService: Detected Niri with socket:", niriSocket)
NiriService.generateNiriBinds()
} else {
isHyprland = false

View File

@@ -22,7 +22,6 @@ Singleton {
property bool subscribeConnected: false
readonly property string socketPath: Quickshell.env("DMS_SOCKET")
readonly property bool verboseLogs: Quickshell.env("DMS_VERBOSE_LOGS") === "1"
property var pendingRequests: ({})
property int requestIdCounter: 0
@@ -170,9 +169,7 @@ Singleton {
return
}
if (root.verboseLogs) {
console.log("DMSService: Request socket <<", line)
}
console.log("DMSService: Request socket <<", line)
try {
const response = JSON.parse(line)
@@ -202,9 +199,7 @@ Singleton {
return
}
if (root.verboseLogs) {
console.log("DMSService: Subscribe socket <<", line)
}
console.log("DMSService: Subscribe socket <<", line)
try {
const response = JSON.parse(line)
@@ -221,9 +216,7 @@ Singleton {
"method": "subscribe"
}
if (verboseLogs) {
console.log("DMSService: Subscribing to all services")
}
console.log("DMSService: Subscribing to all services")
subscribeSocket.send(request)
}
@@ -254,7 +247,7 @@ Singleton {
apiVersion = data.apiVersion || 0
capabilities = data.capabilities || []
console.log("DMSService: Connected (API v" + apiVersion + ") -", JSON.stringify(capabilities))
console.info("DMSService: Connected (API v" + apiVersion + ") -", JSON.stringify(capabilities))
if (apiVersion < expectedApiVersion) {
ToastService.showError("DMS server is outdated (API v" + apiVersion + ", expected v" + expectedApiVersion + ")")

View File

@@ -682,7 +682,7 @@ Singleton {
// Prefer PRETTY_NAME, fallback to NAME
const distroName = prettyName || name || "Linux"
distribution = distroName
console.log("Detected distribution:", distroName)
console.info("Detected distribution:", distroName)
} catch (e) {
console.warn("Failed to parse /etc/os-release:", e)
distribution = "Linux"

View File

@@ -511,7 +511,7 @@ Singleton {
if (ddcAvailable) {
ddcDisplayDetectionProcess.running = true
} else {
console.log("DisplayService: ddcutil not available")
console.info("DisplayService: ddcutil not available")
}
}
}
@@ -547,7 +547,7 @@ Singleton {
}
ddcDevices = newDdcDevices
console.log("DisplayService: Found", ddcDevices.length, "DDC displays")
console.info("DisplayService: Found", ddcDevices.length, "DDC displays")
// Queue initial brightness readings for DDC devices
ddcInitQueue = []

View File

@@ -55,7 +55,7 @@ Singleton {
function createIdleMonitors() {
if (!idleMonitorAvailable) {
console.log("IdleService: IdleMonitor not available, skipping creation")
console.info("IdleService: IdleMonitor not available, skipping creation")
return
}
@@ -149,7 +149,7 @@ Singleton {
if (!idleMonitorAvailable) {
console.warn("IdleService: IdleMonitor not available - power management disabled. This requires a newer version of Quickshell.")
} else {
console.log("IdleService: Initialized with idle monitoring support")
console.info("IdleService: Initialized with idle monitoring support")
createIdleMonitors()
}
}

View File

@@ -116,7 +116,7 @@ Singleton {
function activate() {
if (!isActive) {
isActive = true
console.log("LegacyNetworkService: Activating...")
console.info("LegacyNetworkService: Activating...")
initializeDBusMonitors()
}
}

View File

@@ -108,10 +108,8 @@ Singleton {
target: DMSService
function onNetworkStateUpdate(data) {
if (DMSService.verboseLogs) {
const networksCount = data.wifiNetworks?.length ?? "null"
console.log("NetworkManagerService: Subscription update received, networks:", networksCount)
}
const networksCount = data.wifiNetworks?.length ?? "null"
console.log("NetworkManagerService: Subscription update received, networks:", networksCount)
updateState(data)
}
}
@@ -150,9 +148,7 @@ Singleton {
networkAvailable = DMSService.capabilities.includes("network")
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Network available:", networkAvailable)
}
console.log("NetworkManagerService: Network available:", networkAvailable)
if (networkAvailable && !stateInitialized) {
stateInitialized = true
@@ -195,9 +191,7 @@ Singleton {
if (response.result) {
updateState(response.result)
if (!initialStateFetched && response.result.wifiEnabled && (!response.result.wifiNetworks || response.result.wifiNetworks.length === 0)) {
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Initial state has no networks, triggering scan")
}
console.log("NetworkManagerService: Initial state has no networks, triggering scan")
initialStateFetched = true
Qt.callLater(() => scanWifi())
}
@@ -259,10 +253,8 @@ Singleton {
if (pendingConnectionSSID) {
if (wifiConnected && currentWifiSSID === pendingConnectionSSID && wifiIP) {
if (DMSService.verboseLogs) {
const elapsed = Date.now() - pendingConnectionStartTime
console.log("NetworkManagerService: Successfully connected to", pendingConnectionSSID, "in", elapsed, "ms")
}
const elapsed = Date.now() - pendingConnectionStartTime
console.info("NetworkManagerService: Successfully connected to", pendingConnectionSSID, "in", elapsed, "ms")
ToastService.showInfo(`Connected to ${pendingConnectionSSID}`)
if (userPreference === "wifi" || userPreference === "auto") {
@@ -275,14 +267,10 @@ Singleton {
const elapsed = Date.now() - pendingConnectionStartTime
if (elapsed < 5000) {
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Quick connection failure, likely authentication error")
}
console.log("NetworkManagerService: Quick connection failure, likely authentication error")
connectionStatus = "invalid_password"
} else {
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Connection failed for", pendingConnectionSSID)
}
console.log("NetworkManagerService: Connection failed for", pendingConnectionSSID)
if (connectionError === "connection-failed") {
ToastService.showError(I18n.tr("Connection failed. Check password and try again."))
} else if (connectionError) {
@@ -327,18 +315,14 @@ Singleton {
function scanWifi() {
if (!networkAvailable || isScanning || !wifiEnabled) return
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Starting WiFi scan...")
}
console.log("NetworkManagerService: Starting WiFi scan...")
isScanning = true
DMSService.sendRequest("network.wifi.scan", null, response => {
isScanning = false
if (response.error) {
console.warn("NetworkManagerService: WiFi scan failed:", response.error)
} else {
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Scan completed")
}
console.info("NetworkManagerService: Scan completed")
Qt.callLater(() => getState())
}
})
@@ -378,9 +362,7 @@ Singleton {
DMSService.sendRequest("network.wifi.connect", params, response => {
if (response.error) {
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Connection request failed:", response.error)
}
console.log("NetworkManagerService: Connection request failed:", response.error)
connectionError = response.error
lastConnectionError = response.error
@@ -388,9 +370,7 @@ Singleton {
connectionStatus = "failed"
ToastService.showError(I18n.tr("Failed to start connection to ") + ssid)
} else {
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Connection request sent for", ssid)
}
console.log("NetworkManagerService: Connection request sent for", ssid)
}
})
}
@@ -418,9 +398,7 @@ Singleton {
save: save || false
}
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Submitting credentials for token", token)
}
console.log("NetworkManagerService: Submitting credentials for token", token)
credentialsRequested = false
@@ -439,9 +417,7 @@ Singleton {
cancel: true
}
if (DMSService.verboseLogs) {
console.log("NetworkManagerService: Cancelling credentials for token", token)
}
console.log("NetworkManagerService: Cancelling credentials for token", token)
credentialsRequested = false
pendingConnectionSSID = ""

View File

@@ -87,9 +87,9 @@ Singleton {
readonly property string socketPath: Quickshell.env("DMS_SOCKET")
Component.onCompleted: {
console.log("NetworkService: Initializing...")
console.info("NetworkService: Initializing...")
if (!socketPath || socketPath.length === 0) {
console.log("NetworkService: DMS_SOCKET not set, using LegacyNetworkService")
console.info("NetworkService: DMS_SOCKET not set, using LegacyNetworkService")
useLegacyService()
} else {
console.log("NetworkService: DMS_SOCKET found, waiting for capabilities...")
@@ -101,13 +101,13 @@ Singleton {
function onNetworkAvailableChanged() {
if (!activeService && NetworkManagerService.networkAvailable) {
console.log("NetworkService: Network capability detected, using NetworkManagerService")
console.info("NetworkService: Network capability detected, using NetworkManagerService")
activeService = NetworkManagerService
usingLegacy = false
console.log("NetworkService: Switched to NetworkManagerService, networkAvailable:", networkAvailable)
console.info("NetworkService: Switched to NetworkManagerService, networkAvailable:", networkAvailable)
connectSignals()
} else if (!activeService && !NetworkManagerService.networkAvailable && socketPath && socketPath.length > 0) {
console.log("NetworkService: Network capability not available in DMS, using LegacyNetworkService")
console.info("NetworkService: Network capability not available in DMS, using LegacyNetworkService")
useLegacyService()
}
}
@@ -116,7 +116,7 @@ Singleton {
function useLegacyService() {
activeService = LegacyNetworkService
usingLegacy = true
console.log("NetworkService: Switched to LegacyNetworkService, networkAvailable:", networkAvailable)
console.info("NetworkService: Switched to LegacyNetworkService, networkAvailable:", networkAvailable)
if (LegacyNetworkService.activate) {
LegacyNetworkService.activate()
}

View File

@@ -89,7 +89,7 @@ Singleton {
onExited: exitCode => {
if (exitCode === 0) {
console.log("NiriService: Generated layout config at", configPath)
console.info("NiriService: Generated layout config at", configPath)
return
}
console.warn("NiriService: Failed to write layout config, exit code:", exitCode)
@@ -102,7 +102,7 @@ Singleton {
onExited: exitCode => {
if (exitCode === 0) {
console.log("NiriService: Generated binds config at", bindsPath)
console.info("NiriService: Generated binds config at", bindsPath)
return
}
console.warn("NiriService: Failed to write binds config, exit code:", exitCode)
@@ -150,7 +150,7 @@ Singleton {
try {
const outputsData = JSON.parse(output)
outputs = outputsData
console.log("NiriService: Loaded", Object.keys(outputsData).length, "outputs")
console.info("NiriService: Loaded", Object.keys(outputsData).length, "outputs")
updateDisplayScales()
if (windows.length > 0) {
windows = sortWindowsByLayout(windows)

View File

@@ -174,7 +174,7 @@ Singleton {
if (socketPath && socketPath.length > 0) {
checkDMSCapabilities()
} else {
console.log("PortalService: DMS_SOCKET not set")
console.info("PortalService: DMS_SOCKET not set")
}
colorSchemeDetector.running = true
}
@@ -212,7 +212,7 @@ Singleton {
checkAccountsService()
checkSettingsPortal()
} else {
console.log("PortalService: freedesktop capability not available in DMS")
console.info("PortalService: freedesktop capability not available in DMS")
}
}

View File

@@ -23,7 +23,6 @@ Singleton {
if ((node.type & PwNodeType.AudioInStream) === PwNodeType.AudioInStream) {
if (!looksLikeSystemVirtualMic(node)) {
console.log(node.audio)
if (node.audio && node.audio.muted) {
return false
}

View File

@@ -59,7 +59,7 @@ Singleton {
detectElogindProcess.running = true
detectHibernateProcess.running = true
detectPrimeRunProcess.running = true
console.log("SessionService: Native inhibitor available:", nativeInhibitorAvailable)
console.info("SessionService: Native inhibitor available:", nativeInhibitorAvailable)
if (!SettingsData.loginctlLockIntegration) {
console.log("SessionService: loginctl lock integration disabled by user")
return