Logger: huge cleanup

This commit is contained in:
lysec
2025-10-16 15:07:11 +02:00
parent fca8d7a10e
commit 838491ba33
67 changed files with 372 additions and 376 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ Item {
item.onLoaded()
}
//Logger.log("BarWidgetLoader", "Loaded", widgetId, "on screen", item.screen.name)
//Logger.i("BarWidgetLoader", "Loaded", widgetId, "on screen", item.screen.name)
}
Component.onDestruction: {
@@ -67,7 +67,7 @@ Item {
// Error handling
onWidgetIdChanged: {
if (widgetId && !BarWidgetRegistry.hasWidget(widgetId)) {
Logger.warn("BarWidgetLoader", "Widget not found in registry:", widgetId)
Logger.w("BarWidgetLoader", "Widget not found in registry:", widgetId)
}
}
}
+2 -2
View File
@@ -30,12 +30,12 @@ PopupWindow {
function showAt(item, x, y) {
if (!item) {
Logger.warn("TrayMenu", "anchorItem is undefined, won't show menu.")
Logger.w("TrayMenu", "anchorItem is undefined, won't show menu.")
return
}
if (!opener.children || opener.children.values.length === 0) {
//Logger.warn("TrayMenu", "Menu not ready, delaying show")
//Logger.w("TrayMenu", "Menu not ready, delaying show")
Qt.callLater(() => showAt(item, x, y))
return
}
+5 -5
View File
@@ -72,7 +72,7 @@ Item {
return iconResult
}
} catch (iconError) {
Logger.warn("ActiveWindow", "Error getting icon from CompositorService:", iconError)
Logger.w("ActiveWindow", "Error getting icon from CompositorService:", iconError)
}
}
@@ -90,14 +90,14 @@ Item {
}
}
} catch (fallbackError) {
Logger.warn("ActiveWindow", "Error getting icon from ToplevelManager:", fallbackError)
Logger.w("ActiveWindow", "Error getting icon from ToplevelManager:", fallbackError)
}
}
}
return ThemeIcons.iconFromName(fallbackIcon)
} catch (e) {
Logger.warn("ActiveWindow", "Error in getAppIcon:", e)
Logger.w("ActiveWindow", "Error in getAppIcon:", e)
return ThemeIcons.iconFromName(fallbackIcon)
}
}
@@ -367,7 +367,7 @@ Item {
windowIcon.source = Qt.binding(getAppIcon)
windowIconVertical.source = Qt.binding(getAppIcon)
} catch (e) {
Logger.warn("ActiveWindow", "Error in onActiveWindowChanged:", e)
Logger.w("ActiveWindow", "Error in onActiveWindowChanged:", e)
}
}
function onWindowListChanged() {
@@ -375,7 +375,7 @@ Item {
windowIcon.source = Qt.binding(getAppIcon)
windowIconVertical.source = Qt.binding(getAppIcon)
} catch (e) {
Logger.warn("ActiveWindow", "Error in onWindowListChanged:", e)
Logger.w("ActiveWindow", "Error in onWindowListChanged:", e)
}
}
}
+3 -3
View File
@@ -112,7 +112,7 @@ Item {
function onClicked() {
if (leftClickExec) {
Quickshell.execDetached(["sh", "-c", leftClickExec])
Logger.log("CustomButton", `Executing command: ${leftClickExec}`)
Logger.i("CustomButton", `Executing command: ${leftClickExec}`)
} else if (!hasExec) {
// No script was defined, open settings
var settingsPanel = PanelService.getPanel("settingsPanel")
@@ -124,14 +124,14 @@ Item {
function onRightClicked() {
if (rightClickExec) {
Quickshell.execDetached(["sh", "-c", rightClickExec])
Logger.log("CustomButton", `Executing command: ${rightClickExec}`)
Logger.i("CustomButton", `Executing command: ${rightClickExec}`)
}
}
function onMiddleClicked() {
if (middleClickExec) {
Quickshell.execDetached(["sh", "-c", middleClickExec])
Logger.log("CustomButton", `Executing command: ${middleClickExec}`)
Logger.i("CustomButton", `Executing command: ${middleClickExec}`)
}
}
}
+2 -2
View File
@@ -51,7 +51,7 @@ Item {
Connections {
target: AudioService.source?.audio ? AudioService.source?.audio : null
function onVolumeChanged() {
// Logger.log("Bar:Microphone", "onInputVolumeChanged")
// Logger.i("Bar:Microphone", "onInputVolumeChanged")
if (!firstInputVolumeReceived) {
// Ignore the first volume change
firstInputVolumeReceived = true
@@ -66,7 +66,7 @@ Item {
Connections {
target: AudioService.source?.audio ? AudioService.source?.audio : null
function onMutedChanged() {
// Logger.log("Bar:Microphone", "onInputMutedChanged")
// Logger.i("Bar:Microphone", "onInputMutedChanged")
if (!firstInputVolumeReceived) {
// Ignore the first mute change
firstInputVolumeReceived = true
+2 -2
View File
@@ -168,13 +168,13 @@ Rectangle {
try {
CompositorService.focusWindow(taskbarItem.modelData)
} catch (error) {
Logger.error("Taskbar", "Failed to activate toplevel: " + error)
Logger.e("Taskbar", "Failed to activate toplevel: " + error)
}
} else if (mouse.button === Qt.RightButton) {
try {
CompositorService.closeWindow(taskbarItem.modelData)
} catch (error) {
Logger.error("Taskbar", "Failed to close toplevel: " + error)
Logger.e("Taskbar", "Failed to close toplevel: " + error)
}
}
}
+5 -5
View File
@@ -43,7 +43,7 @@ Rectangle {
if (!str || !rule) {
return false
}
Logger.log("Tray", "wildCardMatch - Input str:", str, "rule:", rule)
Logger.i("Tray", "wildCardMatch - Input str:", str, "rule:", rule)
// Escape all special regex characters in the rule
let escapedRule = rule.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
@@ -52,15 +52,15 @@ Rectangle {
// Add ^ and $ to match the entire string
pattern = '^' + pattern + '$'
Logger.log("Tray", "wildCardMatch - Generated pattern:", pattern)
Logger.i("Tray", "wildCardMatch - Generated pattern:", pattern)
try {
const regex = new RegExp(pattern, 'i')
// 'i' for case-insensitive
Logger.log("Tray", "wildCardMatch - Regex test result:", regex.test(str))
Logger.i("Tray", "wildCardMatch - Regex test result:", regex.test(str))
return regex.test(str)
} catch (e) {
Logger.warn("Tray", "Invalid regex pattern for wildcard match:", rule, e.message)
Logger.w("Tray", "Invalid regex pattern for wildcard match:", rule, e.message)
return false // If regex is invalid, it won't match
}
}
@@ -252,7 +252,7 @@ Rectangle {
trayMenu.item.menu = modelData.menu
trayMenu.item.showAt(parent, menuX, menuY)
} else {
Logger.log("Tray", "No menu available for", modelData.id, "or trayMenu not set")
Logger.i("Tray", "No menu available for", modelData.id, "or trayMenu not set")
}
}
}
+1 -1
View File
@@ -51,7 +51,7 @@ Item {
Connections {
target: AudioService.sink?.audio ? AudioService.sink?.audio : null
function onVolumeChanged() {
// Logger.log("Bar:Volume", "onVolumeChanged")
// Logger.i("Bar:Volume", "onVolumeChanged")
if (!firstVolumeReceived) {
// Ignore the first volume change
firstVolumeReceived = true
+1 -1
View File
@@ -37,7 +37,7 @@ NIconButton {
}
return connected ? NetworkService.signalIcon(signalStrength) : "wifi-off"
} catch (error) {
Logger.error("Wi-Fi", "Error getting icon:", error)
Logger.e("Wi-Fi", "Error getting icon:", error)
return "signal_wifi_bad"
}
}