Merge branch 'main' into auto-night-mode

This commit is contained in:
Leopold Luley
2025-10-16 17:42:47 +02:00
67 changed files with 372 additions and 376 deletions
+2 -2
View File
@@ -106,11 +106,11 @@ Singleton {
printErrors: false printErrors: false
watchChanges: true watchChanges: true
onFileChanged: { onFileChanged: {
Logger.log("Color", "Reloading colors from disk") Logger.i("Color", "Reloading colors from disk")
reload() reload()
} }
onAdapterUpdated: { onAdapterUpdated: {
Logger.log("Color", "Writing colors to disk") Logger.i("Color", "Writing colors to disk")
writeAdapter() writeAdapter()
} }
+30 -46
View File
@@ -7,8 +7,6 @@ import qs.Commons
Singleton { Singleton {
id: root id: root
property bool debug: false
property string debugForceLanguage: "" property string debugForceLanguage: ""
property bool isLoaded: false property bool isLoaded: false
@@ -36,7 +34,7 @@ Singleton {
var output = stdoutCollector.text || "" var output = stdoutCollector.text || ""
parseDirectoryListing(output) parseDirectoryListing(output)
} else { } else {
Logger.error("I18n", `Failed to scan translation directory`) Logger.e("I18n", `Failed to scan translation directory`)
// Fallback to default languages // Fallback to default languages
availableLanguages = ["en"] availableLanguages = ["en"]
detectLanguage() detectLanguage()
@@ -53,21 +51,19 @@ Singleton {
try { try {
var data = JSON.parse(text()) var data = JSON.parse(text())
root.translations = data root.translations = data
Logger.log("I18n", `Loaded translations for "${root.langCode}"`) Logger.i("I18n", `Loaded translations for "${root.langCode}"`)
if (debug) { Logger.d("I18n", `Available root keys: ${Object.keys(data).join(", ")}`)
Logger.log("I18n", `Available root keys: ${Object.keys(data).join(", ")}`)
}
root.isLoaded = true root.isLoaded = true
root.translationsLoaded() root.translationsLoaded()
} catch (e) { } catch (e) {
Logger.error("I18n", `Failed to parse translation file: ${e}`) Logger.e("I18n", `Failed to parse translation file: ${e}`)
setLanguage("en") setLanguage("en")
} }
} }
onLoadFailed: function (error) { onLoadFailed: function (error) {
setLanguage("en") setLanguage("en")
Logger.error("I18n", `Failed to load translation file: ${error}`) Logger.e("I18n", `Failed to load translation file: ${error}`)
} }
} }
@@ -80,24 +76,24 @@ Singleton {
try { try {
var data = JSON.parse(text()) var data = JSON.parse(text())
root.fallbackTranslations = data root.fallbackTranslations = data
Logger.log("I18n", `Loaded english fallback translations`) Logger.d("I18n", `Loaded english fallback translations`)
} catch (e) { } catch (e) {
Logger.error("I18n", `Failed to parse fallback translation file: ${e}`) Logger.e("I18n", `Failed to parse fallback translation file: ${e}`)
} }
} }
onLoadFailed: function (error) { onLoadFailed: function (error) {
Logger.error("I18n", `Failed to load fallback translation file: ${error}`) Logger.e("I18n", `Failed to load fallback translation file: ${error}`)
} }
} }
Component.onCompleted: { Component.onCompleted: {
Logger.log("I18n", "Service started") Logger.i("I18n", "Service started")
scanAvailableLanguages() scanAvailableLanguages()
} }
// ------------------------------------------- // -------------------------------------------
function scanAvailableLanguages() { function scanAvailableLanguages() {
Logger.log("I18n", "Scanning for available translation files...") Logger.d("I18n", "Scanning for available translation files...")
directoryScanner.running = true directoryScanner.running = true
} }
@@ -107,7 +103,7 @@ Singleton {
try { try {
if (!output || output.trim() === "") { if (!output || output.trim() === "") {
Logger.warn("I18n", "Empty directory listing output") Logger.w("I18n", "Empty directory listing output")
availableLanguages = ["en"] availableLanguages = ["en"]
detectLanguage() detectLanguage()
return return
@@ -136,17 +132,17 @@ Singleton {
} }
if (languages.length === 0) { if (languages.length === 0) {
Logger.warn("I18n", "No translation files found, using fallback") Logger.w("I18n", "No translation files found, using fallback")
languages = ["en"] // Fallback languages = ["en"] // Fallback
} }
availableLanguages = languages availableLanguages = languages
Logger.log("I18n", `Found ${languages.length} available languages: ${languages.join(', ')}`) Logger.d("I18n", `Found ${languages.length} available languages: ${languages.join(', ')}`)
// Detect language after scanning // Detect language after scanning
detectLanguage() detectLanguage()
} catch (e) { } catch (e) {
Logger.error("I18n", `Failed to parse directory listing: ${e}`) Logger.e("I18n", `Failed to parse directory listing: ${e}`)
// Fallback to default languages // Fallback to default languages
availableLanguages = ["en"] availableLanguages = ["en"]
detectLanguage() detectLanguage()
@@ -155,20 +151,20 @@ Singleton {
// ------------------------------------------- // -------------------------------------------
function detectLanguage() { function detectLanguage() {
Logger.log("I18n", `detectLanguage() called. Available languages: [${availableLanguages.join(', ')}]`) Logger.d("I18n", `detectLanguage() called. Available languages: [${availableLanguages.join(', ')}]`)
if (availableLanguages.length === 0) { if (availableLanguages.length === 0) {
Logger.warn("I18n", "No available languages found") Logger.w("I18n", "No available languages found")
return return
} }
if (debug && debugForceLanguage !== "") { if (Settings.isDebug && debugForceLanguage !== "") {
Logger.log("I18n", `Debug mode: forcing language to "${debugForceLanguage}"`) Logger.d("I18n", `Debug mode: forcing language to "${debugForceLanguage}"`)
if (availableLanguages.includes(debugForceLanguage)) { if (availableLanguages.includes(debugForceLanguage)) {
setLanguage(debugForceLanguage) setLanguage(debugForceLanguage)
return return
} else { } else {
Logger.warn("I18n", `Debug language "${debugForceLanguage}" not available in [${availableLanguages.join(', ')}]`) Logger.w("I18n", `Debug language "${debugForceLanguage}" not available in [${availableLanguages.join(', ')}]`)
} }
} }
@@ -178,7 +174,7 @@ Singleton {
// Try full code match (such as zh CN, en US) // Try full code match (such as zh CN, en US)
if (availableLanguages.includes(fullUserLang)) { if (availableLanguages.includes(fullUserLang)) {
Logger.log("I18n", `Exact match found: "${fullUserLang}"`) Logger.d("I18n", `Exact match found: "${fullUserLang}"`)
setLanguage(fullUserLang) setLanguage(fullUserLang)
return return
} }
@@ -186,12 +182,12 @@ Singleton {
// If full code match fails, try short code matching (such as zh, en) // If full code match fails, try short code matching (such as zh, en)
const shortUserLang = fullUserLang.substring(0, 2) const shortUserLang = fullUserLang.substring(0, 2)
if (availableLanguages.includes(shortUserLang)) { if (availableLanguages.includes(shortUserLang)) {
Logger.log("I18n", `Short code match found: "${shortUserLang}" from "${fullUserLang}"`) Logger.d("I18n", `Short code match found: "${shortUserLang}" from "${fullUserLang}"`)
setLanguage(shortUserLang) setLanguage(shortUserLang)
return return
} }
Logger.log("I18n", `No match for system language: "${fullUserLang}"`) Logger.d("I18n", `No match for system language: "${fullUserLang}"`)
} }
// Fallback to first available language (preferably "en" if available) // Fallback to first available language (preferably "en" if available)
@@ -203,11 +199,11 @@ Singleton {
function setLanguage(newLangCode) { function setLanguage(newLangCode) {
if (newLangCode !== langCode && availableLanguages.includes(newLangCode)) { if (newLangCode !== langCode && availableLanguages.includes(newLangCode)) {
langCode = newLangCode langCode = newLangCode
Logger.log("I18n", `Language set to "${langCode}"`) Logger.i("I18n", `Language set to "${langCode}"`)
languageChanged(langCode) languageChanged(langCode)
loadTranslations() loadTranslations()
} else if (!availableLanguages.includes(newLangCode)) { } else if (!availableLanguages.includes(newLangCode)) {
Logger.warn("I18n", `Language "${newLangCode}" is not available`) Logger.w("I18n", `Language "${newLangCode}" is not available`)
} }
} }
@@ -219,7 +215,7 @@ Singleton {
const filePath = `file://${Quickshell.shellDir}/Assets/Translations/${langCode}.json` const filePath = `file://${Quickshell.shellDir}/Assets/Translations/${langCode}.json`
fileView.path = filePath fileView.path = filePath
isLoaded = false isLoaded = false
Logger.log("I18n", `Loading translations: ${langCode}`) Logger.d("I18n", `Loading translations: ${langCode}`)
// Only load fallback translations if we are not using english and english is available // Only load fallback translations if we are not using english and english is available
if (langCode !== "en" && availableLanguages.includes("en")) { if (langCode !== "en" && availableLanguages.includes("en")) {
@@ -271,7 +267,7 @@ Singleton {
// ------------------------------------------- // -------------------------------------------
// Reload translations (useful for development) // Reload translations (useful for development)
function reload() { function reload() {
Logger.log("I18n", "Reloading translations") Logger.d("I18n", "Reloading translations")
loadTranslations() loadTranslations()
} }
@@ -282,9 +278,7 @@ Singleton {
interpolations = {} interpolations = {}
if (!isLoaded) { if (!isLoaded) {
if (debug) { Logger.d("I18n", "Translations not loaded yet")
Logger.warn("I18n", "Translations not loaded yet")
}
return key return key
} }
@@ -294,20 +288,12 @@ Singleton {
// Look-up translation in the active language // Look-up translation in the active language
var value = translations var value = translations
var notFound = false var notFound = false
if (debug) {
Logger.log("I18n", `Looking up key: "${key}"`)
}
for (var i = 0; i < keys.length; i++) { for (var i = 0; i < keys.length; i++) {
if (value && typeof value === "object" && keys[i] in value) { if (value && typeof value === "object" && keys[i] in value) {
value = value[keys[i]] value = value[keys[i]]
if (debug) {
Logger.log("I18n", `Found key part "${keys[i]}"`)
}
} else { } else {
if (debug) { Logger.d("I18n", `Translation key "${key}" not found at part "${keys[i]}"`)
Logger.warn("I18n", `Translation key "${key}" not found at part "${keys[i]}"`) Logger.d("I18n", `Available keys: ${Object.keys(value || {}).join(", ")}`)
Logger.warn("I18n", `Available keys: ${Object.keys(value || {}).join(", ")}`)
}
notFound = true notFound = true
break break
} }
@@ -333,9 +319,7 @@ Singleton {
} }
if (typeof value !== "string") { if (typeof value !== "string") {
if (debug) { Logger.d("I18n", `Translation key "${key}" is not a string`)
Logger.warn("I18n", `Translation key "${key}" is not a string`)
}
return key return key
} }
+6 -6
View File
@@ -26,14 +26,14 @@ Singleton {
signal fontReloaded signal fontReloaded
Component.onCompleted: { Component.onCompleted: {
Logger.log("Icons", "Service started") Logger.i("Icons", "Service started")
loadFontWithCacheBusting() loadFontWithCacheBusting()
} }
Connections { Connections {
target: Quickshell target: Quickshell
function onReloadCompleted() { function onReloadCompleted() {
Logger.log("Icons", "Quickshell reload completed - forcing font reload") Logger.d("Icons", "Quickshell reload completed - forcing font reload")
reloadFont() reloadFont()
} }
} }
@@ -50,7 +50,7 @@ Singleton {
} }
function loadFontWithCacheBusting() { function loadFontWithCacheBusting() {
Logger.log("Icons", "Loading font with cache busting") Logger.d("Icons", "Loading font with cache busting")
// Destroy old loader first // Destroy old loader first
if (currentFontLoader) { if (currentFontLoader) {
@@ -69,16 +69,16 @@ Singleton {
// Connect to the new loader's status changes // Connect to the new loader's status changes
currentFontLoader.statusChanged.connect(function () { currentFontLoader.statusChanged.connect(function () {
if (currentFontLoader.status === FontLoader.Ready) { if (currentFontLoader.status === FontLoader.Ready) {
Logger.log("Icons", "Font loaded successfully:", currentFontLoader.name, "(version " + fontVersion + ")") Logger.d("Icons", "Font loaded successfully:", currentFontLoader.name, "(version " + fontVersion + ")")
fontReloaded() fontReloaded()
} else if (currentFontLoader.status === FontLoader.Error) { } else if (currentFontLoader.status === FontLoader.Error) {
Logger.error("Icons", "Font failed to load (version " + fontVersion + ")") Logger.e("Icons", "Font failed to load (version " + fontVersion + ")")
} }
}) })
} }
function reloadFont() { function reloadFont() {
Logger.log("Icons", "Forcing font reload...") Logger.d("Icons", "Forcing font reload...")
fontVersion++ fontVersion++
loadFontWithCacheBusting() loadFontWithCacheBusting()
} }
+18 -7
View File
@@ -25,34 +25,45 @@ Singleton {
} }
} }
function log(...args) { // Info log (always visible)
function i(...args) {
var msg = _formatMessage(...args) var msg = _formatMessage(...args)
console.log(msg) console.log(msg)
} }
function warn(...args) { // Debug log (only when Settings.isDebug is true)
function d(...args) {
if (Settings && Settings.isDebug) {
var msg = _formatMessage(...args)
console.log(msg)
}
}
// Warning log
function w(...args) {
var msg = _formatMessage(...args) var msg = _formatMessage(...args)
console.warn(msg) console.warn(msg)
} }
function error(...args) { // Error log
function e(...args) {
var msg = _formatMessage(...args) var msg = _formatMessage(...args)
console.error(msg) console.error(msg)
} }
function callStack() { function callStack() {
var stack = _getStackTrace() var stack = _getStackTrace()
Logger.log("Debug", "--------------------------") Logger.i("Debug", "--------------------------")
Logger.log("Debug", "Current call stack") Logger.i("Debug", "Current call stack")
// Split the stack into lines and log each one // Split the stack into lines and log each one
var stackLines = stack.split('\n') var stackLines = stack.split('\n')
for (var i = 0; i < stackLines.length; i++) { for (var i = 0; i < stackLines.length; i++) {
var line = stackLines[i].trim() // Remove leading/trailing whitespace var line = stackLines[i].trim() // Remove leading/trailing whitespace
if (line.length > 0) { if (line.length > 0) {
// Only log non-empty lines // Only log non-empty lines
Logger.log("Debug", `- ${line}`) Logger.i("Debug", `- ${line}`)
} }
} }
Logger.log("Debug", "--------------------------") Logger.i("Debug", "--------------------------")
} }
} }
+13 -12
View File
@@ -15,6 +15,7 @@ Singleton {
property bool isLoaded: false property bool isLoaded: false
property bool directoriesCreated: false property bool directoriesCreated: false
property int settingsVersion: 16 property int settingsVersion: 16
property bool isDebug: Quickshell.env("NOCTALIA_DEBUG") === "1"
// Define our app directories // Define our app directories
// Default config directory: ~/.config/noctalia // Default config directory: ~/.config/noctalia
@@ -93,7 +94,7 @@ Singleton {
} }
onLoaded: function () { onLoaded: function () {
if (!isLoaded) { if (!isLoaded) {
Logger.log("Settings", "Settings loaded") Logger.i("Settings", "Settings loaded")
upgradeSettingsData() upgradeSettingsData()
validateMonitorConfigurations() validateMonitorConfigurations()
@@ -437,7 +438,7 @@ Singleton {
// Generate default settings at the root of the repo // Generate default settings at the root of the repo
function generateDefaultSettings() { function generateDefaultSettings() {
try { try {
Logger.log("Settings", "Generating settings-default.json") Logger.d("Settings", "Generating settings-default.json")
// Prepare a clean JSON // Prepare a clean JSON
var plainAdapter = QtObj2JS.qtObjectToPlainObject(adapter) var plainAdapter = QtObj2JS.qtObjectToPlainObject(adapter)
@@ -449,7 +450,7 @@ Singleton {
var base64Data = Qt.btoa(jsonData) var base64Data = Qt.btoa(jsonData)
Quickshell.execDetached(["sh", "-c", `echo "${base64Data}" | base64 -d > "${defaultPath}"`]) Quickshell.execDetached(["sh", "-c", `echo "${base64Data}" | base64 -d > "${defaultPath}"`])
} catch (error) { } catch (error) {
Logger.error("Settings", "Failed to generate default settings file: " + error) Logger.e("Settings", "Failed to generate default settings file: " + error)
} }
} }
@@ -461,8 +462,8 @@ Singleton {
availableScreenNames.push(Quickshell.screens[i].name) availableScreenNames.push(Quickshell.screens[i].name)
} }
Logger.log("Settings", "Available monitors: [" + availableScreenNames.join(", ") + "]") Logger.d("Settings", "Available monitors: [" + availableScreenNames.join(", ") + "]")
Logger.log("Settings", "Configured bar monitors: [" + adapter.bar.monitors.join(", ") + "]") Logger.d("Settings", "Configured bar monitors: [" + adapter.bar.monitors.join(", ") + "]")
// Check bar monitors // Check bar monitors
if (adapter.bar.monitors.length > 0) { if (adapter.bar.monitors.length > 0) {
@@ -474,15 +475,15 @@ Singleton {
} }
} }
if (!hasValidBarMonitor) { if (!hasValidBarMonitor) {
Logger.warn("Settings", "No configured bar monitors found on system, clearing bar monitor list to show on all screens") Logger.w("Settings", "No configured bar monitors found on system, clearing bar monitor list to show on all screens")
adapter.bar.monitors = [] adapter.bar.monitors = []
} else { } else {
//Logger.log("Settings", "Found valid bar monitors, keeping configuration") //Logger.i("Settings", "Found valid bar monitors, keeping configuration")
} }
} else { } else {
//Logger.log("Settings", "Bar monitor list is empty, will show on all available screens") //Logger.i("Settings", "Bar monitor list is empty, will show on all available screens")
} }
} }
@@ -492,7 +493,7 @@ Singleton {
function upgradeSettingsData() { function upgradeSettingsData() {
// Wait for BarWidgetRegistry to be ready // Wait for BarWidgetRegistry to be ready
if (!BarWidgetRegistry.widgets || Object.keys(BarWidgetRegistry.widgets).length === 0) { if (!BarWidgetRegistry.widgets || Object.keys(BarWidgetRegistry.widgets).length === 0) {
Logger.warn("Settings", "BarWidgetRegistry not ready, deferring upgrade") Logger.w("Settings", "BarWidgetRegistry not ready, deferring upgrade")
Qt.callLater(upgradeSettingsData) Qt.callLater(upgradeSettingsData)
return return
} }
@@ -533,7 +534,7 @@ Singleton {
for (var i = widgets.length - 1; i >= 0; i--) { for (var i = widgets.length - 1; i >= 0; i--) {
var widget = widgets[i] var widget = widgets[i]
if (!BarWidgetRegistry.hasWidget(widget.id)) { if (!BarWidgetRegistry.hasWidget(widget.id)) {
Logger.warn(`Settings`, `Deleted invalid widget ${widget.id}`) Logger.w(`Settings`, `Deleted invalid widget ${widget.id}`)
widgets.splice(i, 1) widgets.splice(i, 1)
removedWidget = true removedWidget = true
} }
@@ -554,7 +555,7 @@ Singleton {
} }
if (upgradeWidget(widget)) { if (upgradeWidget(widget)) {
Logger.log("Settings", `Upgraded ${widget.id} widget:`, JSON.stringify(widget)) Logger.d("Settings", `Upgraded ${widget.id} widget:`, JSON.stringify(widget))
} }
} }
} }
@@ -580,7 +581,7 @@ Singleton {
adapter.bar.widgets["right"].push(({ adapter.bar.widgets["right"].push(({
"id": "ControlCenter" "id": "ControlCenter"
})) }))
Logger.warn("Settings", "Added a ControlCenter widget to the right section") Logger.w("Settings", "Added a ControlCenter widget to the right section")
} }
} }
} }
+4 -4
View File
@@ -118,7 +118,7 @@ Variants {
sourceSize: undefined sourceSize: undefined
onStatusChanged: { onStatusChanged: {
if (status === Image.Error) { if (status === Image.Error) {
Logger.warn("Current wallpaper failed to load:", source) Logger.w("Current wallpaper failed to load:", source)
} else if (status === Image.Ready && !dimensionsCalculated) { } else if (status === Image.Ready && !dimensionsCalculated) {
dimensionsCalculated = true dimensionsCalculated = true
const optimalSize = calculateOptimalWallpaperSize(implicitWidth, implicitHeight) const optimalSize = calculateOptimalWallpaperSize(implicitWidth, implicitHeight)
@@ -147,7 +147,7 @@ Variants {
sourceSize: undefined sourceSize: undefined
onStatusChanged: { onStatusChanged: {
if (status === Image.Error) { if (status === Image.Error) {
Logger.warn("Next wallpaper failed to load:", source) Logger.w("Next wallpaper failed to load:", source)
} else if (status === Image.Ready && !dimensionsCalculated) { } else if (status === Image.Ready && !dimensionsCalculated) {
dimensionsCalculated = true dimensionsCalculated = true
const optimalSize = calculateOptimalWallpaperSize(implicitWidth, implicitHeight) const optimalSize = calculateOptimalWallpaperSize(implicitWidth, implicitHeight)
@@ -336,7 +336,7 @@ Variants {
dim = Qt.size(h * imageAspectRatio, h) dim = Qt.size(h * imageAspectRatio, h)
} }
Logger.log("Background", `Wallpaper resized on ${modelData.name} ${screenWidth}x${screenHeight} @ ${compositorScale}x`, "src:", wpWidth, wpHeight, "dst:", dim.width, dim.height) Logger.d("Background", `Wallpaper resized on ${modelData.name} ${screenWidth}x${screenHeight} @ ${compositorScale}x`, "src:", wpWidth, wpHeight, "dst:", dim.width, dim.height)
return dim return dim
} }
@@ -425,7 +425,7 @@ Variants {
transitionType = "fade" transitionType = "fade"
} }
//Logger.log("Background", "New wallpaper: ", futureWallpaper, "On:", modelData.name, "Transition:", transitionType) //Logger.i("Background", "New wallpaper: ", futureWallpaper, "On:", modelData.name, "Transition:", transitionType)
switch (transitionType) { switch (transitionType) {
case "none": case "none":
setWallpaperImmediate(futureWallpaper) setWallpaperImmediate(futureWallpaper)
+1 -1
View File
@@ -20,7 +20,7 @@ Variants {
Component.onCompleted: { Component.onCompleted: {
if (modelData) { if (modelData) {
Logger.log("Overview", "Loading Overview component for Niri on", modelData.name) Logger.d("Overview", "Loading Overview component for Niri on", modelData.name)
} }
setWallpaperInitial() setWallpaperInitial()
} }
+2 -2
View File
@@ -51,7 +51,7 @@ Item {
item.onLoaded() item.onLoaded()
} }
//Logger.log("BarWidgetLoader", "Loaded", widgetId, "on screen", item.screen.name) //Logger.i("BarWidgetLoader", "Loaded", widgetId, "on screen", item.screen.name)
} }
Component.onDestruction: { Component.onDestruction: {
@@ -67,7 +67,7 @@ Item {
// Error handling // Error handling
onWidgetIdChanged: { onWidgetIdChanged: {
if (widgetId && !BarWidgetRegistry.hasWidget(widgetId)) { 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) { function showAt(item, x, y) {
if (!item) { if (!item) {
Logger.warn("TrayMenu", "anchorItem is undefined, won't show menu.") Logger.w("TrayMenu", "anchorItem is undefined, won't show menu.")
return return
} }
if (!opener.children || opener.children.values.length === 0) { 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)) Qt.callLater(() => showAt(item, x, y))
return return
} }
+5 -5
View File
@@ -72,7 +72,7 @@ Item {
return iconResult return iconResult
} }
} catch (iconError) { } 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) { } catch (fallbackError) {
Logger.warn("ActiveWindow", "Error getting icon from ToplevelManager:", fallbackError) Logger.w("ActiveWindow", "Error getting icon from ToplevelManager:", fallbackError)
} }
} }
} }
return ThemeIcons.iconFromName(fallbackIcon) return ThemeIcons.iconFromName(fallbackIcon)
} catch (e) { } catch (e) {
Logger.warn("ActiveWindow", "Error in getAppIcon:", e) Logger.w("ActiveWindow", "Error in getAppIcon:", e)
return ThemeIcons.iconFromName(fallbackIcon) return ThemeIcons.iconFromName(fallbackIcon)
} }
} }
@@ -367,7 +367,7 @@ Item {
windowIcon.source = Qt.binding(getAppIcon) windowIcon.source = Qt.binding(getAppIcon)
windowIconVertical.source = Qt.binding(getAppIcon) windowIconVertical.source = Qt.binding(getAppIcon)
} catch (e) { } catch (e) {
Logger.warn("ActiveWindow", "Error in onActiveWindowChanged:", e) Logger.w("ActiveWindow", "Error in onActiveWindowChanged:", e)
} }
} }
function onWindowListChanged() { function onWindowListChanged() {
@@ -375,7 +375,7 @@ Item {
windowIcon.source = Qt.binding(getAppIcon) windowIcon.source = Qt.binding(getAppIcon)
windowIconVertical.source = Qt.binding(getAppIcon) windowIconVertical.source = Qt.binding(getAppIcon)
} catch (e) { } 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() { function onClicked() {
if (leftClickExec) { if (leftClickExec) {
Quickshell.execDetached(["sh", "-c", leftClickExec]) Quickshell.execDetached(["sh", "-c", leftClickExec])
Logger.log("CustomButton", `Executing command: ${leftClickExec}`) Logger.i("CustomButton", `Executing command: ${leftClickExec}`)
} else if (!hasExec) { } else if (!hasExec) {
// No script was defined, open settings // No script was defined, open settings
var settingsPanel = PanelService.getPanel("settingsPanel") var settingsPanel = PanelService.getPanel("settingsPanel")
@@ -124,14 +124,14 @@ Item {
function onRightClicked() { function onRightClicked() {
if (rightClickExec) { if (rightClickExec) {
Quickshell.execDetached(["sh", "-c", rightClickExec]) Quickshell.execDetached(["sh", "-c", rightClickExec])
Logger.log("CustomButton", `Executing command: ${rightClickExec}`) Logger.i("CustomButton", `Executing command: ${rightClickExec}`)
} }
} }
function onMiddleClicked() { function onMiddleClicked() {
if (middleClickExec) { if (middleClickExec) {
Quickshell.execDetached(["sh", "-c", 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 { Connections {
target: AudioService.source?.audio ? AudioService.source?.audio : null target: AudioService.source?.audio ? AudioService.source?.audio : null
function onVolumeChanged() { function onVolumeChanged() {
// Logger.log("Bar:Microphone", "onInputVolumeChanged") // Logger.i("Bar:Microphone", "onInputVolumeChanged")
if (!firstInputVolumeReceived) { if (!firstInputVolumeReceived) {
// Ignore the first volume change // Ignore the first volume change
firstInputVolumeReceived = true firstInputVolumeReceived = true
@@ -66,7 +66,7 @@ Item {
Connections { Connections {
target: AudioService.source?.audio ? AudioService.source?.audio : null target: AudioService.source?.audio ? AudioService.source?.audio : null
function onMutedChanged() { function onMutedChanged() {
// Logger.log("Bar:Microphone", "onInputMutedChanged") // Logger.i("Bar:Microphone", "onInputMutedChanged")
if (!firstInputVolumeReceived) { if (!firstInputVolumeReceived) {
// Ignore the first mute change // Ignore the first mute change
firstInputVolumeReceived = true firstInputVolumeReceived = true
+2 -2
View File
@@ -168,13 +168,13 @@ Rectangle {
try { try {
CompositorService.focusWindow(taskbarItem.modelData) CompositorService.focusWindow(taskbarItem.modelData)
} catch (error) { } catch (error) {
Logger.error("Taskbar", "Failed to activate toplevel: " + error) Logger.e("Taskbar", "Failed to activate toplevel: " + error)
} }
} else if (mouse.button === Qt.RightButton) { } else if (mouse.button === Qt.RightButton) {
try { try {
CompositorService.closeWindow(taskbarItem.modelData) CompositorService.closeWindow(taskbarItem.modelData)
} catch (error) { } 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) { if (!str || !rule) {
return false 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 // Escape all special regex characters in the rule
let escapedRule = rule.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') let escapedRule = rule.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
@@ -52,15 +52,15 @@ Rectangle {
// Add ^ and $ to match the entire string // Add ^ and $ to match the entire string
pattern = '^' + pattern + '$' pattern = '^' + pattern + '$'
Logger.log("Tray", "wildCardMatch - Generated pattern:", pattern) Logger.i("Tray", "wildCardMatch - Generated pattern:", pattern)
try { try {
const regex = new RegExp(pattern, 'i') const regex = new RegExp(pattern, 'i')
// 'i' for case-insensitive // '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) return regex.test(str)
} catch (e) { } 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 return false // If regex is invalid, it won't match
} }
} }
@@ -252,7 +252,7 @@ Rectangle {
trayMenu.item.menu = modelData.menu trayMenu.item.menu = modelData.menu
trayMenu.item.showAt(parent, menuX, menuY) trayMenu.item.showAt(parent, menuX, menuY)
} else { } 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 { Connections {
target: AudioService.sink?.audio ? AudioService.sink?.audio : null target: AudioService.sink?.audio ? AudioService.sink?.audio : null
function onVolumeChanged() { function onVolumeChanged() {
// Logger.log("Bar:Volume", "onVolumeChanged") // Logger.i("Bar:Volume", "onVolumeChanged")
if (!firstVolumeReceived) { if (!firstVolumeReceived) {
// Ignore the first volume change // Ignore the first volume change
firstVolumeReceived = true firstVolumeReceived = true
+1 -1
View File
@@ -37,7 +37,7 @@ NIconButton {
} }
return connected ? NetworkService.signalIcon(signalStrength) : "wifi-off" return connected ? NetworkService.signalIcon(signalStrength) : "wifi-off"
} catch (error) { } catch (error) {
Logger.error("Wi-Fi", "Error getting icon:", error) Logger.e("Wi-Fi", "Error getting icon:", error)
return "signal_wifi_bad" return "signal_wifi_bad"
} }
} }
@@ -46,7 +46,7 @@ Item {
item.onLoaded() item.onLoaded()
} }
//Logger.log("ControlCenterWidgetLoader", "Loaded", widgetId, "on screen", item.screen.name) //Logger.i("ControlCenterWidgetLoader", "Loaded", widgetId, "on screen", item.screen.name)
} }
Component.onDestruction: { Component.onDestruction: {
@@ -58,7 +58,7 @@ Item {
// Error handling // Error handling
onWidgetIdChanged: { onWidgetIdChanged: {
if (widgetId && !ControlCenterWidgetRegistry.hasWidget(widgetId)) { if (widgetId && !ControlCenterWidgetRegistry.hasWidget(widgetId)) {
Logger.warn("ControlCenterWidgetLoader", "Widget not found in registry:", widgetId) Logger.w("ControlCenterWidgetLoader", "Widget not found in registry:", widgetId)
} }
} }
} }
+1 -1
View File
@@ -23,7 +23,7 @@ NIconButtonHot {
} }
return connected ? NetworkService.signalIcon(signalStrength) : "wifi-off" return connected ? NetworkService.signalIcon(signalStrength) : "wifi-off"
} catch (error) { } catch (error) {
Logger.error("Wi-Fi", "Error getting icon:", error) Logger.e("Wi-Fi", "Error getting icon:", error)
return "signal_wifi_bad" return "signal_wifi_bad"
} }
} }
+2 -2
View File
@@ -121,7 +121,7 @@ PopupWindow {
function show(item, toplevelData) { function show(item, toplevelData) {
if (!item) { if (!item) {
Logger.warn("DockMenu", "anchorItem is undefined, won't show menu.") Logger.w("DockMenu", "anchorItem is undefined, won't show menu.")
return return
} }
@@ -176,7 +176,7 @@ PopupWindow {
Qt.callLater(root.onAppClosed) Qt.callLater(root.onAppClosed)
} }
} else { } else {
Logger.warn("DockMenu", "Cannot close app - invalid toplevel reference") Logger.w("DockMenu", "Cannot close app - invalid toplevel reference")
} }
root.hide() root.hide()
root.requestClose() root.requestClose()
+6 -6
View File
@@ -127,27 +127,27 @@ NPanel {
const appsPlugin = Qt.createComponent("Plugins/ApplicationsPlugin.qml").createObject(this) const appsPlugin = Qt.createComponent("Plugins/ApplicationsPlugin.qml").createObject(this)
if (appsPlugin) { if (appsPlugin) {
registerPlugin(appsPlugin) registerPlugin(appsPlugin)
Logger.log("Launcher", "Registered: ApplicationsPlugin") Logger.d("Launcher", "Registered: ApplicationsPlugin")
} else { } else {
Logger.error("Launcher", "Failed to load ApplicationsPlugin") Logger.e("Launcher", "Failed to load ApplicationsPlugin")
} }
// Load calculator plugin // Load calculator plugin
const calcPlugin = Qt.createComponent("Plugins/CalculatorPlugin.qml").createObject(this) const calcPlugin = Qt.createComponent("Plugins/CalculatorPlugin.qml").createObject(this)
if (calcPlugin) { if (calcPlugin) {
registerPlugin(calcPlugin) registerPlugin(calcPlugin)
Logger.log("Launcher", "Registered: CalculatorPlugin") Logger.d("Launcher", "Registered: CalculatorPlugin")
} else { } else {
Logger.error("Launcher", "Failed to load CalculatorPlugin") Logger.e("Launcher", "Failed to load CalculatorPlugin")
} }
// Load clipboard history plugin // Load clipboard history plugin
const clipboardPlugin = Qt.createComponent("Plugins/ClipboardPlugin.qml").createObject(this) const clipboardPlugin = Qt.createComponent("Plugins/ClipboardPlugin.qml").createObject(this)
if (clipboardPlugin) { if (clipboardPlugin) {
registerPlugin(clipboardPlugin) registerPlugin(clipboardPlugin)
Logger.log("Launcher", "Registered: ClipboardPlugin") Logger.d("Launcher", "Registered: ClipboardPlugin")
} else { } else {
Logger.error("Launcher", "Failed to load ClipboardPlugin") Logger.e("Launcher", "Failed to load ClipboardPlugin")
} }
} }
@@ -54,7 +54,7 @@ Item {
function loadApplications() { function loadApplications() {
if (typeof DesktopEntries === 'undefined') { if (typeof DesktopEntries === 'undefined') {
Logger.warn("ApplicationsPlugin", "DesktopEntries service not available") Logger.w("ApplicationsPlugin", "DesktopEntries service not available")
return return
} }
@@ -64,7 +64,7 @@ Item {
app.executableName = getExecutableName(app) app.executableName = getExecutableName(app)
return app return app
}) })
Logger.log("ApplicationsPlugin", `Loaded ${entries.length} applications`) Logger.d("ApplicationsPlugin", `Loaded ${entries.length} applications`)
} }
function getExecutableName(app) { function getExecutableName(app) {
@@ -198,12 +198,12 @@ Item {
// Ensures we are not preventing the future focusing of the app // Ensures we are not preventing the future focusing of the app
launcher.close() launcher.close()
Logger.log("ApplicationsPlugin", `Launching: ${app.name}`) Logger.d("ApplicationsPlugin", `Launching: ${app.name}`)
// Record usage and persist asynchronously // Record usage and persist asynchronously
if (Settings.data.appLauncher.sortByMostUsed) if (Settings.data.appLauncher.sortByMostUsed)
recordUsage(app) recordUsage(app)
if (Settings.data.appLauncher.useApp2Unit && app.id) { if (Settings.data.appLauncher.useApp2Unit && app.id) {
Logger.log("ApplicationsPlugin", `Using app2unit for: ${app.id}`) Logger.d("ApplicationsPlugin", `Using app2unit for: ${app.id}`)
if (app.runInTerminal) if (app.runInTerminal)
Quickshell.execDetached(["app2unit", "--", app.id + ".desktop"]) Quickshell.execDetached(["app2unit", "--", app.id + ".desktop"])
else else
@@ -212,7 +212,7 @@ Item {
// Fallback logic when app2unit is not used // Fallback logic when app2unit is not used
if (app.runInTerminal) { if (app.runInTerminal) {
// If app.execute() fails for terminal apps, we handle it manually. // If app.execute() fails for terminal apps, we handle it manually.
Logger.log("ApplicationsPlugin", "Executing terminal app manually: " + app.name) Logger.d("ApplicationsPlugin", "Executing terminal app manually: " + app.name)
const terminal = Settings.data.appLauncher.terminalCommand.split(" ") const terminal = Settings.data.appLauncher.terminalCommand.split(" ")
const command = terminal.concat(app.command) const command = terminal.concat(app.command)
Quickshell.execDetached(command) Quickshell.execDetached(command)
@@ -220,7 +220,7 @@ Item {
// Default execution for GUI apps // Default execution for GUI apps
app.execute() app.execute()
} else { } else {
Logger.log("ApplicationsPlugin", `Could not launch: ${app.name}. No valid launch method.`) Logger.w("ApplicationsPlugin", `Could not launch: ${app.name}. No valid launch method.`)
} }
} }
} }
+2 -2
View File
@@ -40,7 +40,7 @@ Item {
// Initialize plugin // Initialize plugin
function init() { function init() {
Logger.log("ClipboardPlugin", "Initialized") Logger.i("ClipboardPlugin", "Initialized")
// Pre-load clipboard data if service is active // Pre-load clipboard data if service is active
if (ClipboardService.active) { if (ClipboardService.active) {
ClipboardService.list(100) ClipboardService.list(100)
@@ -189,7 +189,7 @@ Item {
}) })
} }
//Logger.log("ClipboardPlugin", `Returning ${results.length} results for query: "${query}"`) //Logger.i("ClipboardPlugin", `Returning ${results.length} results for query: "${query}"`)
return results return results
} }
+9 -9
View File
@@ -33,7 +33,7 @@ Scope {
errorMessage = "" errorMessage = ""
showFailure = false showFailure = false
Logger.log("LockContext", "Starting PAM authentication for user:", pam.user) Logger.i("LockContext", "Starting PAM authentication for user:", pam.user)
pam.start() pam.start()
} }
@@ -43,7 +43,7 @@ Scope {
user: Quickshell.env("USER") user: Quickshell.env("USER")
onPamMessage: { onPamMessage: {
Logger.log("LockContext", "PAM message:", message, "isError:", messageIsError, "responseRequired:", responseRequired) Logger.i("LockContext", "PAM message:", message, "isError:", messageIsError, "responseRequired:", responseRequired)
if (messageIsError) { if (messageIsError) {
errorMessage = message errorMessage = message
@@ -52,26 +52,26 @@ Scope {
} }
if (responseRequired) { if (responseRequired) {
Logger.log("LockContext", "Responding to PAM with password") Logger.i("LockContext", "Responding to PAM with password")
respond(root.currentText) respond(root.currentText)
} }
} }
onResponseRequiredChanged: { onResponseRequiredChanged: {
Logger.log("LockContext", "Response required changed:", responseRequired) Logger.i("LockContext", "Response required changed:", responseRequired)
if (responseRequired && root.unlockInProgress) { if (responseRequired && root.unlockInProgress) {
Logger.log("LockContext", "Automatically responding to PAM") Logger.i("LockContext", "Automatically responding to PAM")
respond(root.currentText) respond(root.currentText)
} }
} }
onCompleted: result => { onCompleted: result => {
Logger.log("LockContext", "PAM completed with result:", result) Logger.i("LockContext", "PAM completed with result:", result)
if (result === PamResult.Success) { if (result === PamResult.Success) {
Logger.log("LockContext", "Authentication successful") Logger.i("LockContext", "Authentication successful")
root.unlocked() root.unlocked()
} else { } else {
Logger.log("LockContext", "Authentication failed") Logger.i("LockContext", "Authentication failed")
errorMessage = "Authentication failed" errorMessage = "Authentication failed"
showFailure = true showFailure = true
root.failed() root.failed()
@@ -80,7 +80,7 @@ Scope {
} }
onError: { onError: {
Logger.log("LockContext", "PAM error:", error, "message:", message) Logger.i("LockContext", "PAM error:", error, "message:", message)
errorMessage = message || "Authentication error" errorMessage = message || "Authentication error"
showFailure = true showFailure = true
root.unlockInProgress = false root.unlockInProgress = false
+3 -3
View File
@@ -344,14 +344,14 @@ ColumnLayout {
newArray.splice(toIndex, 0, item) newArray.splice(toIndex, 0, item)
Settings.data.bar.widgets[section] = newArray Settings.data.bar.widgets[section] = newArray
//Logger.log("BarTab", "Widget reordered. New array:", JSON.stringify(newArray)) //Logger.i("BarTab", "Widget reordered. New array:", JSON.stringify(newArray))
} }
} }
function _updateWidgetSettingsInSection(section, index, settings) { function _updateWidgetSettingsInSection(section, index, settings) {
// Update the widget settings in the Settings data // Update the widget settings in the Settings data
Settings.data.bar.widgets[section][index] = settings Settings.data.bar.widgets[section][index] = settings
//Logger.log("BarTab", `Updated widget settings for ${settings.id} in ${section} section`) //Logger.i("BarTab", `Updated widget settings for ${settings.id} in ${section} section`)
} }
function _moveWidgetBetweenSections(fromSection, index, toSection) { function _moveWidgetBetweenSections(fromSection, index, toSection) {
@@ -369,7 +369,7 @@ ColumnLayout {
targetArray.push(widget) targetArray.push(widget)
Settings.data.bar.widgets[toSection] = targetArray Settings.data.bar.widgets[toSection] = targetArray
//Logger.log("BarTab", `Moved widget ${widget.id} from ${fromSection} to ${toSection}`) //Logger.i("BarTab", `Moved widget ${widget.id} from ${fromSection} to ${toSection}`)
} }
} }
+2 -2
View File
@@ -139,7 +139,7 @@ ColumnLayout {
var jsonData = JSON.parse(text()) var jsonData = JSON.parse(text())
root.schemeLoaded(schemeName, jsonData) root.schemeLoaded(schemeName, jsonData)
} catch (e) { } catch (e) {
Logger.warn("ColorSchemeTab", "Failed to parse JSON for scheme:", schemeName, e) Logger.w("ColorSchemeTab", "Failed to parse JSON for scheme:", schemeName, e)
root.schemeLoaded(schemeName, null) root.schemeLoaded(schemeName, null)
} }
} }
@@ -401,7 +401,7 @@ ColumnLayout {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
Settings.data.colorSchemes.useWallpaperColors = false Settings.data.colorSchemes.useWallpaperColors = false
Logger.log("ColorSchemeTab", "Disabled wallpaper colors") Logger.i("ColorSchemeTab", "Disabled wallpaper colors")
Settings.data.colorSchemes.predefinedScheme = schemeItem.schemeName Settings.data.colorSchemes.predefinedScheme = schemeItem.schemeName
ColorSchemeService.applyScheme(Settings.data.colorSchemes.predefinedScheme) ColorSchemeService.applyScheme(Settings.data.colorSchemes.predefinedScheme)
+3 -3
View File
@@ -180,7 +180,7 @@ ColumnLayout {
root.handleDragEnd() root.handleDragEnd()
} }
onItemToggled: function (index, enabled) { onItemToggled: function (index, enabled) {
//Logger.log("ControlCenterTab", "Item", index, "toggled to", enabled) //Logger.i("ControlCenterTab", "Item", index, "toggled to", enabled)
var newModel = cardsModel.slice() var newModel = cardsModel.slice()
newModel[index] = Object.assign({}, newModel[index], { newModel[index] = Object.assign({}, newModel[index], {
"enabled": enabled "enabled": enabled
@@ -189,7 +189,7 @@ ColumnLayout {
saveCards() saveCards()
} }
onItemsReordered: function (fromIndex, toIndex) { onItemsReordered: function (fromIndex, toIndex) {
//Logger.log("ControlCenterTab", "Item moved from", fromIndex, "to", toIndex) //Logger.i("ControlCenterTab", "Item moved from", fromIndex, "to", toIndex)
var newModel = cardsModel.slice() var newModel = cardsModel.slice()
var item = newModel.splice(fromIndex, 1)[0] var item = newModel.splice(fromIndex, 1)[0]
newModel.splice(toIndex, 0, item) newModel.splice(toIndex, 0, item)
@@ -324,7 +324,7 @@ ColumnLayout {
targetArray.push(widget) targetArray.push(widget)
Settings.data.controlCenter.shortcuts[toSection] = targetArray Settings.data.controlCenter.shortcuts[toSection] = targetArray
//Logger.log("BarTab", `Moved widget ${widget.id} from ${fromSection} to ${toSection}`) //Logger.i("BarTab", `Moved widget ${widget.id} from ${fromSection} to ${toSection}`)
} }
} }
+2 -2
View File
@@ -36,13 +36,13 @@ ColumnLayout {
var value = jsonData || {} var value = jsonData || {}
schemeColorsCache[schemeName] = value schemeColorsCache[schemeName] = value
cacheVersion++ cacheVersion++
Logger.log("SetupAppearanceStep", `Loaded scheme ${schemeName}`) Logger.i("SetupAppearanceStep", `Loaded scheme ${schemeName}`)
} }
Connections { Connections {
target: ColorSchemeService target: ColorSchemeService
function onSchemesChanged() { function onSchemesChanged() {
Logger.log("SetupAppearanceStep", `Color schemes changed: ${ColorSchemeService.schemes.length}`) Logger.i("SetupAppearanceStep", `Color schemes changed: ${ColorSchemeService.schemes.length}`)
schemeColorsCache = {} schemeColorsCache = {}
cacheVersion++ cacheVersion++
} }
+3 -3
View File
@@ -363,7 +363,7 @@ NPanel {
} }
function completeSetup() { function completeSetup() {
Logger.log("SetupWizard", "Completing setup with selected options") Logger.i("SetupWizard", "Completing setup with selected options")
if (selectedWallpaperDirectory !== Settings.data.wallpaper.directory) { if (selectedWallpaperDirectory !== Settings.data.wallpaper.directory) {
Settings.data.wallpaper.directory = selectedWallpaperDirectory Settings.data.wallpaper.directory = selectedWallpaperDirectory
@@ -380,7 +380,7 @@ NPanel {
Settings.data.setupCompleted = true Settings.data.setupCompleted = true
Settings.saveImmediate() Settings.saveImmediate()
Logger.log("SetupWizard", "Setup completed successfully") Logger.i("SetupWizard", "Setup completed successfully")
root.close() root.close()
} }
@@ -402,7 +402,7 @@ NPanel {
} }
Component.onCompleted: { Component.onCompleted: {
Logger.log("SetupWizard", "Setup wizard opened") Logger.i("SetupWizard", "Setup wizard opened")
// Initialize selections from existing settings to avoid overwriting user config // Initialize selections from existing settings to avoid overwriting user config
if (Settings && Settings.data) { if (Settings && Settings.data) {
selectedScaleRatio = Settings.data.general.scaleRatio selectedScaleRatio = Settings.data.general.scaleRatio
+2 -2
View File
@@ -44,11 +44,11 @@ Item {
function enqueueToast(toastData) { function enqueueToast(toastData) {
// Safe logging - fix the substring bug // Safe logging - fix the substring bug
var descPreview = (toastData.description || "").substring(0, 100).replace(/\n/g, " ") var descPreview = (toastData.description || "").substring(0, 100).replace(/\n/g, " ")
Logger.log("ToastScreen", "Queuing", toastData.type, ":", toastData.message, descPreview) Logger.i("ToastScreen", "Queuing", toastData.type, ":", toastData.message, descPreview)
// Bounded queue to prevent unbounded memory growth // Bounded queue to prevent unbounded memory growth
if (messageQueue.length >= maxQueueSize) { if (messageQueue.length >= maxQueueSize) {
Logger.log("ToastScreen", "Queue full, dropping oldest toast") Logger.i("ToastScreen", "Queue full, dropping oldest toast")
messageQueue.shift() messageQueue.shift()
} }
+7 -7
View File
@@ -81,14 +81,14 @@ Singleton {
Connections { Connections {
target: Settings.data.colorSchemes target: Settings.data.colorSchemes
function onDarkModeChanged() { function onDarkModeChanged() {
Logger.log("AppThemeService", "Detected dark mode change") Logger.i("AppThemeService", "Detected dark mode change")
AppThemeService.generate() AppThemeService.generate()
} }
} }
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
function init() { function init() {
Logger.log("AppThemeService", "Service started") Logger.i("AppThemeService", "Service started")
} }
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
@@ -106,10 +106,10 @@ Singleton {
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
function generateFromWallpaper() { function generateFromWallpaper() {
// Logger.log("AppThemeService", "Generating from wallpaper on screen:", Screen.name) // Logger.i("AppThemeService", "Generating from wallpaper on screen:", Screen.name)
const wp = WallpaperService.getWallpaper(Screen.name).replace(/'/g, "'\\''") const wp = WallpaperService.getWallpaper(Screen.name).replace(/'/g, "'\\''")
if (!wp) { if (!wp) {
Logger.error("AppThemeService", "No wallpaper found") Logger.e("AppThemeService", "No wallpaper found")
return return
} }
@@ -141,7 +141,7 @@ Singleton {
// Instead, we use 'sed' to apply a custom palette to the existing matugen templates. // Instead, we use 'sed' to apply a custom palette to the existing matugen templates.
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
function generateFromPredefinedScheme(schemeData) { function generateFromPredefinedScheme(schemeData) {
Logger.log("AppThemeService", "Generating templates from predefined color scheme") Logger.i("AppThemeService", "Generating templates from predefined color scheme")
handleTerminalThemes() handleTerminalThemes()
@@ -349,7 +349,7 @@ Singleton {
stderr: StdioCollector { stderr: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.warn("AppThemeService", "GenerateProcess stderr:", this.text) Logger.w("AppThemeService", "GenerateProcess stderr:", this.text)
} }
} }
} }
@@ -361,7 +361,7 @@ Singleton {
stderr: StdioCollector { stderr: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.warn("AppThemeService", "CopyProcess stderr:", this.text) Logger.w("AppThemeService", "CopyProcess stderr:", this.text)
} }
} }
} }
+7 -7
View File
@@ -61,7 +61,7 @@ Singleton {
function onMutedChanged() { function onMutedChanged() {
root._muted = (sink?.audio.muted ?? true) root._muted = (sink?.audio.muted ?? true)
Logger.log("AudioService", "OnMuteChanged:", root._muted) Logger.i("AudioService", "OnMuteChanged:", root._muted)
ToastService.showNotice(I18n.tr("settings.audio.devices.output-device.label"), root._muted ? I18n.tr("toast.audio.muted") : I18n.tr("toast.audio.unmuted")) ToastService.showNotice(I18n.tr("settings.audio.devices.output-device.label"), root._muted ? I18n.tr("toast.audio.muted") : I18n.tr("toast.audio.unmuted"))
} }
} }
@@ -79,7 +79,7 @@ Singleton {
function onMutedChanged() { function onMutedChanged() {
root._inputMuted = (source?.audio.muted ?? true) root._inputMuted = (source?.audio.muted ?? true)
Logger.log("AudioService", "OnInputMuteChanged:", root._inputMuted) Logger.i("AudioService", "OnInputMuteChanged:", root._inputMuted)
ToastService.showNotice(I18n.tr("settings.audio.devices.input-device.label"), root._inputMuted ? I18n.tr("toast.audio.muted") : I18n.tr("toast.audio.unmuted")) ToastService.showNotice(I18n.tr("settings.audio.devices.input-device.label"), root._inputMuted ? I18n.tr("toast.audio.muted") : I18n.tr("toast.audio.unmuted"))
} }
} }
@@ -97,9 +97,9 @@ Singleton {
// Clamp it accordingly // Clamp it accordingly
sink.audio.muted = false sink.audio.muted = false
sink.audio.volume = Math.max(0, Math.min(Settings.data.audio.volumeOverdrive ? 1.5 : 1.0, newVolume)) sink.audio.volume = Math.max(0, Math.min(Settings.data.audio.volumeOverdrive ? 1.5 : 1.0, newVolume))
//Logger.log("AudioService", "SetVolume", sink.audio.volume); //Logger.i("AudioService", "SetVolume", sink.audio.volume);
} else { } else {
Logger.warn("AudioService", "No sink available") Logger.w("AudioService", "No sink available")
} }
} }
@@ -107,7 +107,7 @@ Singleton {
if (sink?.ready && sink?.audio) { if (sink?.ready && sink?.audio) {
sink.audio.muted = muted sink.audio.muted = muted
} else { } else {
Logger.warn("AudioService", "No sink available") Logger.w("AudioService", "No sink available")
} }
} }
@@ -125,7 +125,7 @@ Singleton {
source.audio.muted = false source.audio.muted = false
source.audio.volume = Math.max(0, Math.min(Settings.data.audio.volumeOverdrive ? 1.5 : 1.0, newVolume)) source.audio.volume = Math.max(0, Math.min(Settings.data.audio.volumeOverdrive ? 1.5 : 1.0, newVolume))
} else { } else {
Logger.warn("AudioService", "No source available") Logger.w("AudioService", "No source available")
} }
} }
@@ -133,7 +133,7 @@ Singleton {
if (source?.ready && source?.audio) { if (source?.ready && source?.audio) {
source.audio.muted = muted source.audio.muted = muted
} else { } else {
Logger.warn("AudioService", "No source available") Logger.w("AudioService", "No source available")
} }
} }
+5 -5
View File
@@ -38,14 +38,14 @@ Singleton {
} }
Component.onCompleted: { Component.onCompleted: {
Logger.log("BarService", "Service started") Logger.d("BarService", "Service started")
} }
// Function for the Bar to call when it's ready // Function for the Bar to call when it's ready
function registerBar(screenName) { function registerBar(screenName) {
if (!readyBars[screenName]) { if (!readyBars[screenName]) {
readyBars[screenName] = true readyBars[screenName] = true
Logger.log("BarService", "Bar is ready on screen:", screenName) Logger.d("BarService", "Bar is ready on screen:", screenName)
barReadyChanged(screenName) barReadyChanged(screenName)
} }
} }
@@ -69,7 +69,7 @@ Singleton {
timerCheckVisualizer.restart() timerCheckVisualizer.restart()
Logger.log("BarService", "Registered widget:", key) Logger.d("BarService", "Registered widget:", key)
root.activeWidgetsChanged() root.activeWidgetsChanged()
} }
@@ -77,7 +77,7 @@ Singleton {
function unregisterWidget(screenName, section, widgetId, index) { function unregisterWidget(screenName, section, widgetId, index) {
const key = [screenName, section, widgetId, index].join("|") const key = [screenName, section, widgetId, index].join("|")
delete widgetInstances[key] delete widgetInstances[key]
Logger.log("BarService", "Unregistered widget:", key) Logger.d("BarService", "Unregistered widget:", key)
root.activeWidgetsChanged() root.activeWidgetsChanged()
} }
@@ -219,7 +219,7 @@ Singleton {
} }
} }
} catch (e) { } catch (e) {
Logger.error(e) Logger.e(e)
} }
return false return false
} }
+1 -1
View File
@@ -215,7 +215,7 @@ Singleton {
} }
function init() { function init() {
Logger.log("BarWidgetRegistry", "Service started") Logger.i("BarWidgetRegistry", "Service started")
} }
// ------------------------------ // ------------------------------
+15 -15
View File
@@ -69,7 +69,7 @@ Singleton {
function setChargingMode(newMode) { function setChargingMode(newMode) {
if (newMode !== BatteryService.ChargingMode.Full && newMode !== BatteryService.ChargingMode.Balanced && newMode !== BatteryService.ChargingMode.Lifespan) { if (newMode !== BatteryService.ChargingMode.Full && newMode !== BatteryService.ChargingMode.Balanced && newMode !== BatteryService.ChargingMode.Lifespan) {
Logger.warn("BatteryService", `Invalid charging mode set ${newMode}`) Logger.w("BatteryService", `Invalid charging mode set ${newMode}`)
return return
} }
BatteryService.chargingMode = newMode BatteryService.chargingMode = newMode
@@ -112,7 +112,7 @@ Singleton {
running: false running: false
onExited: (exitCode, exitStatus) => { onExited: (exitCode, exitStatus) => {
if (exitCode === 0) { if (exitCode === 0) {
Logger.log("BatteryService", "Battery threshold set successfully") Logger.i("BatteryService", "Battery threshold set successfully")
if (BatteryService.initialSetter) { if (BatteryService.initialSetter) {
BatteryService.initialSetter = false BatteryService.initialSetter = false
return return
@@ -127,20 +127,20 @@ Singleton {
BatteryService.runInstaller() BatteryService.runInstaller()
} else { } else {
ToastService.showError(I18n.tr("toast.battery-manager.title"), I18n.tr("toast.battery-manager.set-failed")) ToastService.showError(I18n.tr("toast.battery-manager.title"), I18n.tr("toast.battery-manager.set-failed"))
Logger.error("BatteryService", `Setter process failed with exit code: ${exitCode}`) Logger.e("BatteryService", `Setter process failed with exit code: ${exitCode}`)
} }
} }
stderr: StdioCollector { stderr: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.warn("BatteryService", "SetterProcess stderr:", this.text) Logger.w("BatteryService", "SetterProcess stderr:", this.text)
} }
} }
} }
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.log("BatteryService", "SetterProcess stdout:", this.text) Logger.i("BatteryService", "SetterProcess stdout:", this.text)
} }
} }
} }
@@ -170,14 +170,14 @@ Singleton {
stderr: StdioCollector { stderr: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.warn("BatteryService", "InstallerProcess stderr:", this.text) Logger.w("BatteryService", "InstallerProcess stderr:", this.text)
} }
} }
} }
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.log("BatteryService", "InstallerProcess stdout:", this.text) Logger.i("BatteryService", "InstallerProcess stdout:", this.text)
} }
} }
} }
@@ -190,27 +190,27 @@ Singleton {
running: false running: false
onExited: (exitCode, exitStatus) => { onExited: (exitCode, exitStatus) => {
if (exitCode === 0) { if (exitCode === 0) {
Logger.log("BatteryService", "Battery Manager uninstalled successfully") Logger.i("BatteryService", "Battery Manager uninstalled successfully")
ToastService.showNotice(I18n.tr("toast.battery-manager.title"), I18n.tr("toast.battery-manager.uninstall-success")) ToastService.showNotice(I18n.tr("toast.battery-manager.title"), I18n.tr("toast.battery-manager.uninstall-success"))
Settings.data.battery.chargingMode = BatteryService.chargingMode Settings.data.battery.chargingMode = BatteryService.chargingMode
BatteryService.chargingMode = BatteryService.ChargingMode.Disabled BatteryService.chargingMode = BatteryService.ChargingMode.Disabled
cleanupProcess.running = true cleanupProcess.running = true
} else { } else {
ToastService.showError(I18n.tr("toast.battery-manager.title"), I18n.tr("toast.battery-manager.uninstall-failed")) ToastService.showError(I18n.tr("toast.battery-manager.title"), I18n.tr("toast.battery-manager.uninstall-failed"))
Logger.error("BatteryService", `Uninstaller process failed with exit code: ${exitCode}`) Logger.e("BatteryService", `Uninstaller process failed with exit code: ${exitCode}`)
} }
} }
stderr: StdioCollector { stderr: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.warn("BatteryService", "UninstallerProcess stderr:", this.text) Logger.w("BatteryService", "UninstallerProcess stderr:", this.text)
} }
} }
} }
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.log("BatteryService", "UninstallerProcess stdout:", this.text) Logger.i("BatteryService", "UninstallerProcess stdout:", this.text)
} }
} }
} }
@@ -224,22 +224,22 @@ Singleton {
running: false running: false
onExited: (exitCode, exitStatus) => { onExited: (exitCode, exitStatus) => {
if (exitCode === 0) { if (exitCode === 0) {
Logger.log("BatteryService", "Battery Manager uninstalled successfully") Logger.i("BatteryService", "Battery Manager uninstalled successfully")
} else { } else {
Logger.error("BatteryService", `Cleanup process failed with exit code: ${exitCode}`) Logger.e("BatteryService", `Cleanup process failed with exit code: ${exitCode}`)
} }
} }
stderr: StdioCollector { stderr: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.warn("BatteryService", "CleanupProcess stderr:", this.text) Logger.w("BatteryService", "CleanupProcess stderr:", this.text)
} }
} }
} }
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (this.text) { if (this.text) {
Logger.log("BatteryService", "CleanupProcess stdout:", this.text) Logger.i("BatteryService", "CleanupProcess stdout:", this.text)
} }
} }
} }
+5 -5
View File
@@ -32,7 +32,7 @@ Singleton {
} }
function init() { function init() {
Logger.log("Bluetooth", "Service initialized") Logger.i("Bluetooth", "Service initialized")
} }
Timer { Timer {
@@ -46,11 +46,11 @@ Singleton {
target: adapter target: adapter
function onEnabledChanged() { function onEnabledChanged() {
if (!adapter) { if (!adapter) {
Logger.warn("Bluetooth", "onEnabledChanged", "No adapter available") Logger.w("Bluetooth", "onEnabledChanged", "No adapter available")
return return
} }
Logger.log("Bluetooth", "onEnableChanged", adapter.enabled) Logger.d("Bluetooth", "onEnableChanged", adapter.enabled)
if (adapter.enabled) { if (adapter.enabled) {
ToastService.showNotice(I18n.tr("bluetooth.panel.title"), I18n.tr("toast.bluetooth.enabled")) ToastService.showNotice(I18n.tr("bluetooth.panel.title"), I18n.tr("toast.bluetooth.enabled"))
discoveryTimer.running = true discoveryTimer.running = true
@@ -225,11 +225,11 @@ Singleton {
function setBluetoothEnabled(state) { function setBluetoothEnabled(state) {
if (!adapter) { if (!adapter) {
Logger.warn("Bluetooth", "No adapter available") Logger.w("Bluetooth", "No adapter available")
return return
} }
Logger.log("Bluetooth", "SetBluetoothEnabled", state) Logger.i("Bluetooth", "SetBluetoothEnabled", state)
adapter.enabled = state adapter.enabled = state
} }
} }
+8 -8
View File
@@ -46,7 +46,7 @@ Singleton {
reloadableId: "brightness" reloadableId: "brightness"
Component.onCompleted: { Component.onCompleted: {
Logger.log("Brightness", "Service started") Logger.i("Brightness", "Service started")
} }
onMonitorsChanged: { onMonitorsChanged: {
@@ -85,7 +85,7 @@ Singleton {
var ddcModel = ddcModelMatch ? ddcModelMatch.length > 0 : false var ddcModel = ddcModelMatch ? ddcModelMatch.length > 0 : false
var model = modelMatch ? modelMatch[1] : "Unknown" var model = modelMatch ? modelMatch[1] : "Unknown"
var bus = busMatch ? busMatch[1] : "Unknown" var bus = busMatch ? busMatch[1] : "Unknown"
Logger.log("Brigthness", "Detected DDC Monitor:", model, "on bus", bus, "is DDC:", !ddcModel) Logger.i("Brigthness", "Detected DDC Monitor:", model, "on bus", bus, "is DDC:", !ddcModel)
return { return {
"model": model, "model": model,
"busNum": bus, "busNum": bus,
@@ -141,7 +141,7 @@ Singleton {
monitor.brightness = newBrightness monitor.brightness = newBrightness
monitor.brightnessUpdated(monitor.brightness) monitor.brightnessUpdated(monitor.brightness)
root.monitorBrightnessChanged(monitor, monitor.brightness) root.monitorBrightnessChanged(monitor, monitor.brightness)
//Logger.log("Brightness", "Refreshed brightness from system:", monitor.modelData.name, monitor.brightness) //Logger.i("Brightness", "Refreshed brightness from system:", monitor.modelData.name, monitor.brightness)
} }
} }
} }
@@ -190,12 +190,12 @@ Singleton {
return return
} }
//Logger.log("Brightness", "Raw brightness data for", monitor.modelData.name + ":", dataText) //Logger.i("Brightness", "Raw brightness data for", monitor.modelData.name + ":", dataText)
if (monitor.isAppleDisplay) { if (monitor.isAppleDisplay) {
var val = parseInt(dataText) var val = parseInt(dataText)
if (!isNaN(val)) { if (!isNaN(val)) {
monitor.brightness = val / 101 monitor.brightness = val / 101
Logger.log("Brightness", "Apple display brightness:", monitor.brightness) Logger.d("Brightness", "Apple display brightness:", monitor.brightness)
} }
} else if (monitor.isDdc) { } else if (monitor.isDdc) {
var parts = dataText.split(" ") var parts = dataText.split(" ")
@@ -204,7 +204,7 @@ Singleton {
var max = parseInt(parts[4]) var max = parseInt(parts[4])
if (!isNaN(current) && !isNaN(max) && max > 0) { if (!isNaN(current) && !isNaN(max) && max > 0) {
monitor.brightness = current / max monitor.brightness = current / max
Logger.log("Brightness", "DDC brightness:", current + "/" + max + " =", monitor.brightness) Logger.d("Brightness", "DDC brightness:", current + "/" + max + " =", monitor.brightness)
} }
} }
} else { } else {
@@ -220,8 +220,8 @@ Singleton {
if (!isNaN(current) && !isNaN(max) && max > 0) { if (!isNaN(current) && !isNaN(max) && max > 0) {
monitor.maxBrightness = max monitor.maxBrightness = max
monitor.brightness = current / max monitor.brightness = current / max
Logger.log("Brightness", "Internal brightness:", current + "/" + max + " =", monitor.brightness) Logger.d("Brightness", "Internal brightness:", current + "/" + max + " =", monitor.brightness)
Logger.log("Brightness", "Using backlight device:", monitor.backlightDevice) Logger.d("Brightness", "Using backlight device:", monitor.backlightDevice)
} }
} }
} }
+1 -1
View File
@@ -40,7 +40,7 @@ Singleton {
running: root.shouldRun running: root.shouldRun
command: ["cava", "-p", "/dev/stdin"] command: ["cava", "-p", "/dev/stdin"]
onRunningChanged: { onRunningChanged: {
Logger.log("Cava", "Process running:", running) Logger.d("Cava", "Process running:", running)
} }
onExited: { onExited: {
stdinEnabled = true stdinEnabled = true
+8 -8
View File
@@ -18,7 +18,7 @@ Singleton {
Connections { Connections {
target: Settings.data.colorSchemes target: Settings.data.colorSchemes
function onDarkModeChanged() { function onDarkModeChanged() {
Logger.log("ColorScheme", "Detected dark mode change") Logger.i("ColorScheme", "Detected dark mode change")
if (!Settings.data.colorSchemes.useWallpaperColors && Settings.data.colorSchemes.predefinedScheme) { if (!Settings.data.colorSchemes.useWallpaperColors && Settings.data.colorSchemes.predefinedScheme) {
// Re-apply current scheme to pick the right variant // Re-apply current scheme to pick the right variant
applyScheme(Settings.data.colorSchemes.predefinedScheme) applyScheme(Settings.data.colorSchemes.predefinedScheme)
@@ -35,12 +35,12 @@ Singleton {
function init() { function init() {
// does nothing but ensure the singleton is created // does nothing but ensure the singleton is created
// do not remove // do not remove
Logger.log("ColorScheme", "Service started") Logger.i("ColorScheme", "Service started")
loadColorSchemes() loadColorSchemes()
} }
function loadColorSchemes() { function loadColorSchemes() {
Logger.log("ColorScheme", "Load colorScheme") Logger.d("ColorScheme", "Load colorScheme")
scanning = true scanning = true
schemes = [] schemes = []
// Use find command to locate all scheme.json files // Use find command to locate all scheme.json files
@@ -108,7 +108,7 @@ Singleton {
}) })
schemes = files schemes = files
scanning = false scanning = false
Logger.log("ColorScheme", "Listed", schemes.length, "schemes") Logger.d("ColorScheme", "Listed", schemes.length, "schemes")
// Normalize stored scheme to basename and re-apply if necessary // Normalize stored scheme to basename and re-apply if necessary
var stored = Settings.data.colorSchemes.predefinedScheme var stored = Settings.data.colorSchemes.predefinedScheme
if (stored) { if (stored) {
@@ -121,7 +121,7 @@ Singleton {
} }
} }
} else { } else {
Logger.error("ColorScheme", "Failed to find color scheme files") Logger.e("ColorScheme", "Failed to find color scheme files")
schemes = [] schemes = []
scanning = false scanning = false
} }
@@ -147,14 +147,14 @@ Singleton {
} }
} }
writeColorsToDisk(variant) writeColorsToDisk(variant)
Logger.log("ColorScheme", "Applying color scheme:", getBasename(path)) Logger.i("ColorScheme", "Applying color scheme:", getBasename(path))
// Generate Matugen templates if any are enabled and setting allows it // Generate Matugen templates if any are enabled and setting allows it
if (Settings.data.colorSchemes.generateTemplatesForPredefined && hasEnabledTemplates()) { if (Settings.data.colorSchemes.generateTemplatesForPredefined && hasEnabledTemplates()) {
AppThemeService.generateFromPredefinedScheme(data) AppThemeService.generateFromPredefinedScheme(data)
} }
} catch (e) { } catch (e) {
Logger.error("ColorScheme", "Failed to parse scheme JSON:", path, e) Logger.e("ColorScheme", "Failed to parse scheme JSON:", path, e)
} }
} }
} }
@@ -171,7 +171,7 @@ Singleton {
path: colorsJsonFilePath path: colorsJsonFilePath
onSaved: { onSaved: {
// Logger.log("ColorScheme", "Colors saved") // Logger.i("ColorScheme", "Colors saved")
} }
JsonAdapter { JsonAdapter {
id: out id: out
+14 -14
View File
@@ -100,13 +100,13 @@ Singleton {
// Load cached display scales // Load cached display scales
displayScales = displayCacheAdapter.displays || {} displayScales = displayCacheAdapter.displays || {}
displayScalesLoaded = true displayScalesLoaded = true
// Logger.log("CompositorService", "Loaded display scales from cache:", JSON.stringify(displayScales)) // Logger.i("CompositorService", "Loaded display scales from cache:", JSON.stringify(displayScales))
} }
onLoadFailed: { onLoadFailed: {
// Cache doesn't exist yet, will be created on first update // Cache doesn't exist yet, will be created on first update
displayScalesLoaded = true displayScalesLoaded = true
// Logger.log("CompositorService", "No display cache found, will create on first update") // Logger.i("CompositorService", "No display cache found, will create on first update")
} }
} }
@@ -195,7 +195,7 @@ Singleton {
// Update display scales from backend // Update display scales from backend
function updateDisplayScales() { function updateDisplayScales() {
if (!backend || !backend.queryDisplayScales) { if (!backend || !backend.queryDisplayScales) {
Logger.warn("CompositorService", "Backend does not support display scale queries") Logger.w("CompositorService", "Backend does not support display scale queries")
return return
} }
@@ -207,7 +207,7 @@ Singleton {
displayScales = scales displayScales = scales
saveDisplayScalesToCache() saveDisplayScalesToCache()
displayScalesChanged() displayScalesChanged()
Logger.log("CompositorService", "Display scales updated") Logger.i("CompositorService", "Display scales updated")
} }
// Save display scales to cache // Save display scales to cache
@@ -261,7 +261,7 @@ Singleton {
if (backend && backend.switchToWorkspace) { if (backend && backend.switchToWorkspace) {
backend.switchToWorkspace(workspace) backend.switchToWorkspace(workspace)
} else { } else {
Logger.warn("Compositor", "No backend available for workspace switching") Logger.w("Compositor", "No backend available for workspace switching")
} }
} }
@@ -293,7 +293,7 @@ Singleton {
if (backend && backend.focusWindow) { if (backend && backend.focusWindow) {
backend.focusWindow(window) backend.focusWindow(window)
} else { } else {
Logger.warn("Compositor", "No backend available for window focus") Logger.w("Compositor", "No backend available for window focus")
} }
} }
@@ -302,43 +302,43 @@ Singleton {
if (backend && backend.closeWindow) { if (backend && backend.closeWindow) {
backend.closeWindow(window) backend.closeWindow(window)
} else { } else {
Logger.warn("Compositor", "No backend available for window closing") Logger.w("Compositor", "No backend available for window closing")
} }
} }
// Session management // Session management
function logout() { function logout() {
if (backend && backend.logout) { if (backend && backend.logout) {
Logger.log("Compositor", "Logout requested") Logger.i("Compositor", "Logout requested")
backend.logout() backend.logout()
} else { } else {
Logger.warn("Compositor", "No backend available for logout") Logger.w("Compositor", "No backend available for logout")
} }
} }
function shutdown() { function shutdown() {
Logger.log("Compositor", "Shutdown requested") Logger.i("Compositor", "Shutdown requested")
Quickshell.execDetached(["shutdown", "-h", "now"]) Quickshell.execDetached(["shutdown", "-h", "now"])
} }
function reboot() { function reboot() {
Logger.log("Compositor", "Reboot requested") Logger.i("Compositor", "Reboot requested")
Quickshell.execDetached(["reboot"]) Quickshell.execDetached(["reboot"])
} }
function suspend() { function suspend() {
Logger.log("Compositor", "Suspend requested") Logger.i("Compositor", "Suspend requested")
Quickshell.execDetached(["systemctl", "suspend"]) Quickshell.execDetached(["systemctl", "suspend"])
} }
function lockAndSuspend() { function lockAndSuspend() {
Logger.log("Compositor", "Lock and suspend requested") Logger.i("Compositor", "Lock and suspend requested")
try { try {
if (PanelService && PanelService.lockScreen && !PanelService.lockScreen.active) { if (PanelService && PanelService.lockScreen && !PanelService.lockScreen.active) {
PanelService.lockScreen.active = true PanelService.lockScreen.active = true
} }
} catch (e) { } catch (e) {
Logger.warn("Compositor", "Failed to activate lock screen before suspend: " + e) Logger.w("Compositor", "Failed to activate lock screen before suspend: " + e)
} }
// Queue suspend to the next event loop cycle to allow lock UI to render // Queue suspend to the next event loop cycle to allow lock UI to render
Qt.callLater(suspend) Qt.callLater(suspend)
+1 -1
View File
@@ -49,7 +49,7 @@ Singleton {
} }
function init() { function init() {
Logger.log("ControlCenterWidgetRegistry", "Service started") Logger.i("ControlCenterWidgetRegistry", "Service started")
} }
// ------------------------------ // ------------------------------
+3 -3
View File
@@ -82,7 +82,7 @@ Singleton {
if (logoName) if (logoName)
resolveLogo(logoName) resolveLogo(logoName)
} catch (e) { } catch (e) {
Logger.warn("DistroService", "failed to read os-release", e) Logger.w("DistroService", "failed to read os-release", e)
} }
} }
} }
@@ -93,10 +93,10 @@ Singleton {
const p = String(stdout.text || "").trim() const p = String(stdout.text || "").trim()
if (code === 0 && p) { if (code === 0 && p) {
root.osLogo = `file://${p}` root.osLogo = `file://${p}`
Logger.log("DistroService", "found", root.osLogo) Logger.i("DistroService", "found", root.osLogo)
} else { } else {
root.osLogo = "" root.osLogo = ""
Logger.warn("DistroService", "none found") Logger.w("DistroService", "none found")
} }
} }
stdout: StdioCollector {} stdout: StdioCollector {}
+3 -3
View File
@@ -26,7 +26,7 @@ Singleton {
// ------------------------------------------- // -------------------------------------------
function init() { function init() {
Logger.log("Font", "Service started") Logger.i("Font", "Service started")
loadFontconfigMonospaceFonts() loadFontconfigMonospaceFonts()
} }
@@ -39,7 +39,7 @@ Singleton {
if (isLoading) if (isLoading)
return return
Logger.log("Font", "Loading system fonts...") Logger.d("Font", "Loading system fonts...")
isLoading = true isLoading = true
var fontFamilies = Qt.fontFamilies() var fontFamilies = Qt.fontFamilies()
@@ -125,7 +125,7 @@ Singleton {
fontsLoaded = true fontsLoaded = true
isLoading = false isLoading = false
Logger.log("Font", "Loaded", availableFonts.count, "fonts:", monospaceFonts.count, "monospace,", displayFonts.count, "display") Logger.d("Font", "Loaded", availableFonts.count, "fonts:", monospaceFonts.count, "monospace,", displayFonts.count, "display")
} }
function isMonospaceFont(fontName) { function isMonospaceFont(fontName) {
+15 -15
View File
@@ -53,11 +53,11 @@ Singleton {
function loadFromCache() { function loadFromCache() {
const now = Time.timestamp const now = Time.timestamp
if (!data.timestamp || (now >= data.timestamp + githubUpdateFrequency)) { if (!data.timestamp || (now >= data.timestamp + githubUpdateFrequency)) {
Logger.log("GitHub", "Cache expired or missing, fetching new data") Logger.d("GitHub", "Cache expired or missing, fetching new data")
fetchFromGitHub() fetchFromGitHub()
return return
} }
Logger.log("GitHub", "Loading cached GitHub data (age:", Math.round((now - data.timestamp) / 60), "minutes)") Logger.d("GitHub", "Loading cached GitHub data (age:", Math.round((now - data.timestamp) / 60), "minutes)")
if (data.version) { if (data.version) {
root.latestVersion = data.version root.latestVersion = data.version
@@ -70,7 +70,7 @@ Singleton {
// -------------------------------- // --------------------------------
function fetchFromGitHub() { function fetchFromGitHub() {
if (isFetchingData) { if (isFetchingData) {
Logger.warn("GitHub", "GitHub data is still fetching") Logger.w("GitHub", "GitHub data is still fetching")
return return
} }
@@ -82,8 +82,8 @@ Singleton {
// -------------------------------- // --------------------------------
function saveData() { function saveData() {
data.timestamp = Time.timestamp data.timestamp = Time.timestamp
Logger.log("GitHub", "Saving data to cache file:", githubDataFile) Logger.d("GitHub", "Saving data to cache file:", githubDataFile)
Logger.log("GitHub", "Data to save - version:", data.version, "contributors:", data.contributors.length) Logger.d("GitHub", "Data to save - version:", data.version, "contributors:", data.contributors.length)
// Ensure cache directory exists // Ensure cache directory exists
Quickshell.execDetached(["mkdir", "-p", Settings.cacheDir]) Quickshell.execDetached(["mkdir", "-p", Settings.cacheDir])
@@ -91,7 +91,7 @@ Singleton {
Qt.callLater(() => { Qt.callLater(() => {
// Use direct ID reference to the FileView // Use direct ID reference to the FileView
githubDataFileView.writeAdapter() githubDataFileView.writeAdapter()
Logger.log("GitHub", "Cache file written successfully") Logger.d("GitHub", "Cache file written successfully")
}) })
} }
@@ -120,15 +120,15 @@ Singleton {
const version = data.tag_name const version = data.tag_name
root.data.version = version root.data.version = version
root.latestVersion = version root.latestVersion = version
Logger.log("GitHub", "Latest version fetched from GitHub:", version) Logger.d("GitHub", "Latest version fetched from GitHub:", version)
} else { } else {
Logger.log("GitHub", "No tag_name in GitHub response") Logger.w("GitHub", "No tag_name in GitHub response")
} }
} else { } else {
Logger.log("GitHub", "Empty response from GitHub API") Logger.w("GitHub", "Empty response from GitHub API")
} }
} catch (e) { } catch (e) {
Logger.error("GitHub", "Failed to parse version:", e) Logger.e("GitHub", "Failed to parse version:", e)
} }
// Check if both processes are done // Check if both processes are done
@@ -146,20 +146,20 @@ Singleton {
onStreamFinished: { onStreamFinished: {
try { try {
const response = text const response = text
Logger.log("GitHub", "Raw contributors response length:", response ? response.length : 0) Logger.d("GitHub", "Raw contributors response length:", response ? response.length : 0)
if (response && response.trim()) { if (response && response.trim()) {
const data = JSON.parse(response) const data = JSON.parse(response)
Logger.log("GitHub", "Parsed contributors data type:", typeof data, "length:", Array.isArray(data) ? data.length : "not array") Logger.d("GitHub", "Parsed contributors data type:", typeof data, "length:", Array.isArray(data) ? data.length : "not array")
root.data.contributors = data || [] root.data.contributors = data || []
root.contributors = root.data.contributors root.contributors = root.data.contributors
Logger.log("GitHub", "Contributors fetched from GitHub:", root.contributors.length) Logger.d("GitHub", "Contributors fetched from GitHub:", root.contributors.length)
} else { } else {
Logger.log("GitHub", "Empty response from GitHub API for contributors") Logger.w("GitHub", "Empty response from GitHub API for contributors")
root.data.contributors = [] root.data.contributors = []
root.contributors = [] root.contributors = []
} }
} catch (e) { } catch (e) {
Logger.error("GitHub", "Failed to parse contributors:", e) Logger.e("GitHub", "Failed to parse contributors:", e)
root.data.contributors = [] root.data.contributors = []
root.contributors = [] root.contributors = []
} }
+5 -5
View File
@@ -38,9 +38,9 @@ Singleton {
let command = script.replace(/\$1/g, wallpaperPath) let command = script.replace(/\$1/g, wallpaperPath)
command = command.replace(/\$2/g, screenName || "") command = command.replace(/\$2/g, screenName || "")
Quickshell.execDetached(["sh", "-c", command]) Quickshell.execDetached(["sh", "-c", command])
Logger.log("HooksService", `Executed wallpaper hook: ${command}`) Logger.d("HooksService", `Executed wallpaper hook: ${command}`)
} catch (e) { } catch (e) {
Logger.error("HooksService", `Failed to execute wallpaper hook: ${e}`) Logger.e("HooksService", `Failed to execute wallpaper hook: ${e}`)
} }
} }
@@ -58,14 +58,14 @@ Singleton {
try { try {
const command = script.replace(/\$1/g, isDarkMode ? "true" : "false") const command = script.replace(/\$1/g, isDarkMode ? "true" : "false")
Quickshell.execDetached(["sh", "-c", command]) Quickshell.execDetached(["sh", "-c", command])
Logger.log("HooksService", `Executed dark mode hook: ${command}`) Logger.d("HooksService", `Executed dark mode hook: ${command}`)
} catch (e) { } catch (e) {
Logger.error("HooksService", `Failed to execute dark mode hook: ${e}`) Logger.e("HooksService", `Failed to execute dark mode hook: ${e}`)
} }
} }
// Initialize the service // Initialize the service
function init() { function init() {
Logger.log("HooksService", "Service initialized") Logger.i("HooksService", "Service initialized")
} }
} }
+10 -10
View File
@@ -45,9 +45,9 @@ Item {
queryDisplayScales() queryDisplayScales()
}) })
initialized = true initialized = true
Logger.log("HyprlandService", "Initialized successfully") Logger.i("HyprlandService", "Initialized successfully")
} catch (e) { } catch (e) {
Logger.error("HyprlandService", "Failed to initialize:", e) Logger.e("HyprlandService", "Failed to initialize:", e)
} }
} }
@@ -74,7 +74,7 @@ Item {
onExited: function (exitCode) { onExited: function (exitCode) {
if (exitCode !== 0 || !accumulatedOutput) { if (exitCode !== 0 || !accumulatedOutput) {
Logger.error("HyprlandService", "Failed to query monitors, exit code:", exitCode) Logger.e("HyprlandService", "Failed to query monitors, exit code:", exitCode)
accumulatedOutput = "" accumulatedOutput = ""
return return
} }
@@ -105,7 +105,7 @@ Item {
CompositorService.onDisplayScalesUpdated(scales) CompositorService.onDisplayScalesUpdated(scales)
} }
} catch (e) { } catch (e) {
Logger.error("HyprlandService", "Failed to parse monitors:", e) Logger.e("HyprlandService", "Failed to parse monitors:", e)
} finally { } finally {
// Clear accumulated output for next query // Clear accumulated output for next query
accumulatedOutput = "" accumulatedOutput = ""
@@ -152,7 +152,7 @@ Item {
workspaces.append(wsData) workspaces.append(wsData)
} }
} catch (e) { } catch (e) {
Logger.error("HyprlandService", "Error updating workspaces:", e) Logger.e("HyprlandService", "Error updating workspaces:", e)
} }
} }
@@ -227,7 +227,7 @@ Item {
activeWindowChanged() activeWindowChanged()
} }
} catch (e) { } catch (e) {
Logger.error("HyprlandService", "Error updating windows:", e) Logger.e("HyprlandService", "Error updating windows:", e)
} }
} }
@@ -345,7 +345,7 @@ Item {
try { try {
Hyprland.dispatch(`workspace ${workspace.idx}`) Hyprland.dispatch(`workspace ${workspace.idx}`)
} catch (e) { } catch (e) {
Logger.error("HyprlandService", "Failed to switch workspace:", e) Logger.e("HyprlandService", "Failed to switch workspace:", e)
} }
} }
@@ -353,7 +353,7 @@ Item {
try { try {
Hyprland.dispatch(`focuswindow address:0x${window.id.toString()}`) Hyprland.dispatch(`focuswindow address:0x${window.id.toString()}`)
} catch (e) { } catch (e) {
Logger.error("HyprlandService", "Failed to switch window:", e) Logger.e("HyprlandService", "Failed to switch window:", e)
} }
} }
@@ -361,7 +361,7 @@ Item {
try { try {
Hyprland.dispatch(`killwindow address:0x${window.id}`) Hyprland.dispatch(`killwindow address:0x${window.id}`)
} catch (e) { } catch (e) {
Logger.error("HyprlandService", "Failed to close window:", e) Logger.e("HyprlandService", "Failed to close window:", e)
} }
} }
@@ -369,7 +369,7 @@ Item {
try { try {
Quickshell.execDetached(["hyprctl", "dispatch", "exit"]) Quickshell.execDetached(["hyprctl", "dispatch", "exit"])
} catch (e) { } catch (e) {
Logger.error("HyprlandService", "Failed to logout:", e) Logger.e("HyprlandService", "Failed to logout:", e)
} }
} }
} }
+2 -2
View File
@@ -230,7 +230,7 @@ Item {
function seekRelative(offset: string) { function seekRelative(offset: string) {
var offsetVal = parseFloat(position) var offsetVal = parseFloat(position)
if (Number.isNaN(offsetVal)) { if (Number.isNaN(offsetVal)) {
Logger.warn("Media", "Argument to ipc call 'media seekRelative' must be a number") Logger.w("Media", "Argument to ipc call 'media seekRelative' must be a number")
return return
} }
MediaService.seekRelative(offsetVal) MediaService.seekRelative(offsetVal)
@@ -239,7 +239,7 @@ Item {
function seekByRatio(position: string) { function seekByRatio(position: string) {
var positionVal = parseFloat(position) var positionVal = parseFloat(position)
if (Number.isNaN(positionVal)) { if (Number.isNaN(positionVal)) {
Logger.warn("Media", "Argument to ipc call 'media seekByRatio' must be a number") Logger.w("Media", "Argument to ipc call 'media seekByRatio' must be a number")
return return
} }
MediaService.seekByRatio(positionVal) MediaService.seekByRatio(positionVal)
+16 -16
View File
@@ -17,13 +17,13 @@ Singleton {
property string strategy: "systemd" // "systemd", "wayland", or "auto" property string strategy: "systemd" // "systemd", "wayland", or "auto"
Component.onCompleted: { Component.onCompleted: {
Logger.log("IdleInhibitor", "Service started") Logger.i("IdleInhibitor", "Service started")
detectStrategy() detectStrategy()
// Restore previous state from settings // Restore previous state from settings
if (Settings.data.ui.idleInhibitorEnabled) { if (Settings.data.ui.idleInhibitorEnabled) {
addInhibitor("manual", "Restored from previous session") addInhibitor("manual", "Restored from previous session")
Logger.log("IdleInhibitor", "Restored previous manual inhibition state") Logger.d("IdleInhibitor", "Restored previous manual inhibition state")
} }
} }
@@ -34,7 +34,7 @@ Singleton {
try { try {
var systemdResult = Quickshell.execDetached(["which", "systemd-inhibit"]) var systemdResult = Quickshell.execDetached(["which", "systemd-inhibit"])
strategy = "systemd" strategy = "systemd"
Logger.log("IdleInhibitor", "Using systemd-inhibit strategy") Logger.d("IdleInhibitor", "Using systemd-inhibit strategy")
return return
} catch (e) { } catch (e) {
@@ -44,14 +44,14 @@ Singleton {
try { try {
var waylandResult = Quickshell.execDetached(["which", "wayhibitor"]) var waylandResult = Quickshell.execDetached(["which", "wayhibitor"])
strategy = "wayland" strategy = "wayland"
Logger.log("IdleInhibitor", "Using wayhibitor strategy") Logger.d("IdleInhibitor", "Using wayhibitor strategy")
return return
} catch (e) { } catch (e) {
// wayhibitor not found // wayhibitor not found
} }
Logger.warn("IdleInhibitor", "No suitable inhibitor found - will try systemd as fallback") Logger.w("IdleInhibitor", "No suitable inhibitor found - will try systemd as fallback")
strategy = "systemd" // Fallback to systemd even if not detected strategy = "systemd" // Fallback to systemd even if not detected
} }
} }
@@ -59,13 +59,13 @@ Singleton {
// Add an inhibitor // Add an inhibitor
function addInhibitor(id, reason = "Application request") { function addInhibitor(id, reason = "Application request") {
if (activeInhibitors.includes(id)) { if (activeInhibitors.includes(id)) {
Logger.warn("IdleInhibitor", "Inhibitor already active:", id) Logger.w("IdleInhibitor", "Inhibitor already active:", id)
return false return false
} }
activeInhibitors.push(id) activeInhibitors.push(id)
updateInhibition(reason) updateInhibition(reason)
Logger.log("IdleInhibitor", "Added inhibitor:", id) Logger.d("IdleInhibitor", "Added inhibitor:", id)
return true return true
} }
@@ -73,13 +73,13 @@ Singleton {
function removeInhibitor(id) { function removeInhibitor(id) {
const index = activeInhibitors.indexOf(id) const index = activeInhibitors.indexOf(id)
if (index === -1) { if (index === -1) {
Logger.warn("IdleInhibitor", "Inhibitor not found:", id) Logger.w("IdleInhibitor", "Inhibitor not found:", id)
return false return false
} }
activeInhibitors.splice(index, 1) activeInhibitors.splice(index, 1)
updateInhibition() updateInhibition()
Logger.log("IdleInhibitor", "Removed inhibitor:", id) Logger.d("IdleInhibitor", "Removed inhibitor:", id)
return true return true
} }
@@ -108,12 +108,12 @@ Singleton {
} else if (strategy === "wayland") { } else if (strategy === "wayland") {
startWaylandInhibition() startWaylandInhibition()
} else { } else {
Logger.warn("IdleInhibitor", "No inhibition strategy available") Logger.w("IdleInhibitor", "No inhibition strategy available")
return return
} }
isInhibited = true isInhibited = true
Logger.log("IdleInhibitor", "Started inhibition:", reason) Logger.i("IdleInhibitor", "Started inhibition:", reason)
} }
// Stop system inhibition // Stop system inhibition
@@ -126,7 +126,7 @@ Singleton {
} }
isInhibited = false isInhibited = false
Logger.log("IdleInhibitor", "Stopped inhibition") Logger.i("IdleInhibitor", "Stopped inhibition")
} }
// Systemd inhibition using systemd-inhibit // Systemd inhibition using systemd-inhibit
@@ -148,13 +148,13 @@ Singleton {
onExited: function (exitCode, exitStatus) { onExited: function (exitCode, exitStatus) {
if (isInhibited) { if (isInhibited) {
Logger.warn("IdleInhibitor", "Inhibitor process exited unexpectedly:", exitCode) Logger.w("IdleInhibitor", "Inhibitor process exited unexpectedly:", exitCode)
isInhibited = false isInhibited = false
} }
} }
onStarted: function () { onStarted: function () {
Logger.log("IdleInhibitor", "Inhibitor process started successfully") Logger.d("IdleInhibitor", "Inhibitor process started successfully")
} }
} }
@@ -164,13 +164,13 @@ Singleton {
removeInhibitor("manual") removeInhibitor("manual")
Settings.data.ui.idleInhibitorEnabled = false Settings.data.ui.idleInhibitorEnabled = false
ToastService.showNotice(I18n.tr("tooltips.keep-awake"), I18n.tr("toast.keep-awake.disabled")) ToastService.showNotice(I18n.tr("tooltips.keep-awake"), I18n.tr("toast.keep-awake.disabled"))
Logger.log("IdleInhibitor", "Manual inhibition disabled and saved to settings") Logger.i("IdleInhibitor", "Manual inhibition disabled and saved to settings")
return false return false
} else { } else {
addInhibitor("manual", "Manually activated by user") addInhibitor("manual", "Manually activated by user")
Settings.data.ui.idleInhibitorEnabled = true Settings.data.ui.idleInhibitorEnabled = true
ToastService.showNotice(I18n.tr("tooltips.keep-awake"), I18n.tr("toast.keep-awake.enabled")) ToastService.showNotice(I18n.tr("tooltips.keep-awake"), I18n.tr("toast.keep-awake.enabled"))
Logger.log("IdleInhibitor", "Manual inhibition enabled and saved to settings") Logger.i("IdleInhibitor", "Manual inhibition enabled and saved to settings")
return true return true
} }
} }
+1 -1
View File
@@ -202,7 +202,7 @@ Singleton {
} }
Component.onCompleted: { Component.onCompleted: {
Logger.log("KeyboardLayout", "Service started") Logger.i("KeyboardLayout", "Service started")
updateLayout() updateLayout()
} }
+11 -11
View File
@@ -28,14 +28,14 @@ Singleton {
printErrors: false printErrors: false
onAdapterUpdated: saveTimer.start() onAdapterUpdated: saveTimer.start()
onLoaded: { onLoaded: {
Logger.log("Location", "Loaded cached data") Logger.d("Location", "Loaded cached data")
// Initialize stable properties on load // Initialize stable properties on load
if (adapter.latitude !== "" && adapter.longitude !== "" && adapter.weatherLastFetch > 0) { if (adapter.latitude !== "" && adapter.longitude !== "" && adapter.weatherLastFetch > 0) {
root.stableLatitude = adapter.latitude root.stableLatitude = adapter.latitude
root.stableLongitude = adapter.longitude root.stableLongitude = adapter.longitude
root.stableName = adapter.name root.stableName = adapter.name
root.coordinatesReady = true root.coordinatesReady = true
Logger.log("Location", "Coordinates ready") Logger.i("Location", "Coordinates ready")
} }
updateWeather() updateWeather()
} }
@@ -87,12 +87,12 @@ Singleton {
function init() { function init() {
// does nothing but ensure the singleton is created // does nothing but ensure the singleton is created
// do not remove // do not remove
Logger.log("Location", "Service started") Logger.i("Location", "Service started")
} }
// -------------------------------- // --------------------------------
function resetWeather() { function resetWeather() {
Logger.log("Location", "Resetting weather data") Logger.i("Location", "Resetting weather data")
// Mark as changing to prevent UI updates // Mark as changing to prevent UI updates
root.coordinatesReady = false root.coordinatesReady = false
@@ -119,7 +119,7 @@ Singleton {
} }
if (isFetchingWeather) { if (isFetchingWeather) {
Logger.warn("Location", "Weather is still fetching") Logger.w("Location", "Weather is still fetching")
return return
} }
@@ -136,13 +136,13 @@ Singleton {
const locationChanged = data.name !== Settings.data.location.name const locationChanged = data.name !== Settings.data.location.name
if (locationChanged) { if (locationChanged) {
root.coordinatesReady = false root.coordinatesReady = false
Logger.log("Location", "Location changed from", adapter.name, "to", Settings.data.location.name) Logger.d("Location", "Location changed from", adapter.name, "to", Settings.data.location.name)
} }
if ((adapter.latitude === "") || (adapter.longitude === "") || locationChanged) { if ((adapter.latitude === "") || (adapter.longitude === "") || locationChanged) {
_geocodeLocation(Settings.data.location.name, function (latitude, longitude, name, country) { _geocodeLocation(Settings.data.location.name, function (latitude, longitude, name, country) {
Logger.log("Location", "Geocoded", Settings.data.location.name, "to:", latitude, "/", longitude) Logger.d("Location", "Geocoded", Settings.data.location.name, "to:", latitude, "/", longitude)
// Save location name // Save location name
adapter.name = Settings.data.location.name adapter.name = Settings.data.location.name
@@ -162,7 +162,7 @@ Singleton {
// -------------------------------- // --------------------------------
function _geocodeLocation(locationName, callback, errorCallback) { function _geocodeLocation(locationName, callback, errorCallback) {
Logger.log("Location", "Geocoding location name") Logger.d("Location", "Geocoding location name")
var geoUrl = "https://assets.noctalia.dev/geocode.php?city=" + encodeURIComponent(locationName) + "&language=en&format=json" var geoUrl = "https://assets.noctalia.dev/geocode.php?city=" + encodeURIComponent(locationName) + "&language=en&format=json"
var xhr = new XMLHttpRequest() var xhr = new XMLHttpRequest()
xhr.onreadystatechange = function () { xhr.onreadystatechange = function () {
@@ -189,7 +189,7 @@ Singleton {
// -------------------------------- // --------------------------------
function _fetchWeather(latitude, longitude, errorCallback) { function _fetchWeather(latitude, longitude, errorCallback) {
Logger.log("Location", "Fetching weather from api.open-meteo.com") Logger.d("Location", "Fetching weather from api.open-meteo.com")
var url = "https://api.open-meteo.com/v1/forecast?latitude=" + latitude + "&longitude=" + longitude + "&current_weather=true&current=relativehumidity_2m,surface_pressure&daily=temperature_2m_max,temperature_2m_min,weathercode,sunset,sunrise&timezone=auto" var url = "https://api.open-meteo.com/v1/forecast?latitude=" + latitude + "&longitude=" + longitude + "&current_weather=true&current=relativehumidity_2m,surface_pressure&daily=temperature_2m_max,temperature_2m_min,weathercode,sunset,sunrise&timezone=auto"
var xhr = new XMLHttpRequest() var xhr = new XMLHttpRequest()
xhr.onreadystatechange = function () { xhr.onreadystatechange = function () {
@@ -209,7 +209,7 @@ Singleton {
root.coordinatesReady = true root.coordinatesReady = true
isFetchingWeather = false isFetchingWeather = false
Logger.log("Location", "Cached weather to disk - stable coordinates updated") Logger.i("Location", "Cached weather to disk - stable coordinates updated")
} catch (e) { } catch (e) {
errorCallback("Location", "Failed to parse weather data") errorCallback("Location", "Failed to parse weather data")
} }
@@ -224,7 +224,7 @@ Singleton {
// -------------------------------- // --------------------------------
function errorCallback(module, message) { function errorCallback(module, message) {
Logger.error(module, message) Logger.e(module, message)
isFetchingWeather = false isFetchingWeather = false
} }
+4 -4
View File
@@ -136,14 +136,14 @@ Singleton {
function findActivePlayer() { function findActivePlayer() {
let availablePlayers = getAvailablePlayers() let availablePlayers = getAvailablePlayers()
if (availablePlayers.length === 0) { if (availablePlayers.length === 0) {
//Logger.log("Media", "No active player found") //Logger.i("Media", "No active player found")
return null return null
} }
// Prioritize the actively playing player --- // Prioritize the actively playing player ---
for (var i = 0; i < availablePlayers.length; i++) { for (var i = 0; i < availablePlayers.length; i++) {
if (availablePlayers[i] && availablePlayers[i].playbackState === MprisPlaybackState.Playing) { if (availablePlayers[i] && availablePlayers[i].playbackState === MprisPlaybackState.Playing) {
Logger.log("Media", "Found actively playing player: " + availablePlayers[i].identity) Logger.d("Media", "Found actively playing player: " + availablePlayers[i].identity)
selectedPlayerIndex = i selectedPlayerIndex = i
return availablePlayers[i] return availablePlayers[i]
} }
@@ -177,7 +177,7 @@ Singleton {
if (newPlayer !== currentPlayer) { if (newPlayer !== currentPlayer) {
currentPlayer = newPlayer currentPlayer = newPlayer
currentPosition = currentPlayer ? currentPlayer.position : 0 currentPosition = currentPlayer ? currentPlayer.position : 0
Logger.log("Media", "Switching player") Logger.d("Media", "Switching player")
} }
} }
@@ -293,7 +293,7 @@ Singleton {
Connections { Connections {
target: Mpris.players target: Mpris.players
function onValuesChanged() { function onValuesChanged() {
Logger.log("Media", "Players changed") Logger.d("Media", "Players changed")
updateCurrentPlayer() updateCurrentPlayer()
} }
} }
+24 -24
View File
@@ -56,7 +56,7 @@ Singleton {
} }
Component.onCompleted: { Component.onCompleted: {
Logger.log("Network", "Service initialized") Logger.i("Network", "Service initialized")
syncWifiState() syncWifiState()
scan() scan()
} }
@@ -105,7 +105,7 @@ Singleton {
if (scanning) { if (scanning) {
// Mark current scan results to be ignored and schedule a new scan // Mark current scan results to be ignored and schedule a new scan
Logger.log("Network", "Scan already in progress, will ignore results and rescan") Logger.d("Network", "Scan already in progress, will ignore results and rescan")
ignoreScanResults = true ignoreScanResults = true
scanPending = true scanPending = true
return return
@@ -117,7 +117,7 @@ Singleton {
// Get existing profiles first, then scan // Get existing profiles first, then scan
profileCheckProcess.running = true profileCheckProcess.running = true
Logger.log("Network", "Wi-Fi scan in progress...") Logger.d("Network", "Wi-Fi scan in progress...")
} }
function connect(ssid, password = "") { function connect(ssid, password = "") {
@@ -229,7 +229,7 @@ Singleton {
}) })
if (root.ethernetConnected !== connected) { if (root.ethernetConnected !== connected) {
root.ethernetConnected = connected root.ethernetConnected = connected
Logger.log("Network", "Ethernet connected:", root.ethernetConnected) Logger.d("Network", "Ethernet connected:", root.ethernetConnected)
} }
} }
} }
@@ -245,7 +245,7 @@ Singleton {
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
const enabled = text.trim() === "enabled" const enabled = text.trim() === "enabled"
Logger.log("Network", "Wi-Fi adapter was detect as enabled:", enabled) Logger.d("Network", "Wi-Fi adapter was detect as enabled:", enabled)
if (Settings.data.network.wifiEnabled !== enabled) { if (Settings.data.network.wifiEnabled !== enabled) {
Settings.data.network.wifiEnabled = enabled Settings.data.network.wifiEnabled = enabled
} }
@@ -261,7 +261,7 @@ Singleton {
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
Logger.log("Network", "Wi-Fi state change command executed.") Logger.i("Network", "Wi-Fi state change command executed.")
// Re-check the state to ensure it's in sync // Re-check the state to ensure it's in sync
syncWifiState() syncWifiState()
} }
@@ -270,7 +270,7 @@ Singleton {
stderr: StdioCollector { stderr: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (text.trim()) { if (text.trim()) {
Logger.warn("Network", "Error changing Wi-Fi state: " + text) Logger.w("Network", "Error changing Wi-Fi state: " + text)
} }
} }
} }
@@ -285,7 +285,7 @@ Singleton {
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (root.ignoreScanResults) { if (root.ignoreScanResults) {
Logger.log("Network", "Ignoring profile check results (new scan requested)") Logger.d("Network", "Ignoring profile check results (new scan requested)")
root.scanning = false root.scanning = false
// Check if we need to start a new scan // Check if we need to start a new scan
@@ -318,7 +318,7 @@ Singleton {
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
if (root.ignoreScanResults) { if (root.ignoreScanResults) {
Logger.log("Network", "Ignoring scan results (new scan requested)") Logger.d("Network", "Ignoring scan results (new scan requested)")
root.scanning = false root.scanning = false
// Check if we need to start a new scan // Check if we need to start a new scan
@@ -344,7 +344,7 @@ Singleton {
// We know the last 3 fields, so everything else is SSID // We know the last 3 fields, so everything else is SSID
const lastColonIdx = line.lastIndexOf(":") const lastColonIdx = line.lastIndexOf(":")
if (lastColonIdx === -1) { if (lastColonIdx === -1) {
Logger.warn("Network", "Malformed nmcli output line:", line) Logger.w("Network", "Malformed nmcli output line:", line)
continue continue
} }
@@ -353,7 +353,7 @@ Singleton {
const secondLastColonIdx = remainingLine.lastIndexOf(":") const secondLastColonIdx = remainingLine.lastIndexOf(":")
if (secondLastColonIdx === -1) { if (secondLastColonIdx === -1) {
Logger.warn("Network", "Malformed nmcli output line:", line) Logger.w("Network", "Malformed nmcli output line:", line)
continue continue
} }
@@ -362,7 +362,7 @@ Singleton {
const thirdLastColonIdx = remainingLine2.lastIndexOf(":") const thirdLastColonIdx = remainingLine2.lastIndexOf(":")
if (thirdLastColonIdx === -1) { if (thirdLastColonIdx === -1) {
Logger.warn("Network", "Malformed nmcli output line:", line) Logger.w("Network", "Malformed nmcli output line:", line)
continue continue
} }
@@ -410,15 +410,15 @@ Singleton {
if (newNetworks.length > 0 || lostNetworks.length > 0) { if (newNetworks.length > 0 || lostNetworks.length > 0) {
if (newNetworks.length > 0) { if (newNetworks.length > 0) {
Logger.log("Network", "New Wi-Fi SSID discovered:", newNetworks.join(", ")) Logger.d("Network", "New Wi-Fi SSID discovered:", newNetworks.join(", "))
} }
if (lostNetworks.length > 0) { if (lostNetworks.length > 0) {
Logger.log("Network", "Wi-Fi SSID disappeared:", lostNetworks.join(", ")) Logger.d("Network", "Wi-Fi SSID disappeared:", lostNetworks.join(", "))
} }
Logger.log("Network", "Total Wi-Fi SSIDs:", Object.keys(networksMap).length) Logger.d("Network", "Total Wi-Fi SSIDs:", Object.keys(networksMap).length)
} }
Logger.log("Network", "Wi-Fi scan completed") Logger.d("Network", "Wi-Fi scan completed")
root.networks = networksMap root.networks = networksMap
root.scanning = false root.scanning = false
@@ -435,7 +435,7 @@ Singleton {
onStreamFinished: { onStreamFinished: {
root.scanning = false root.scanning = false
if (text.trim()) { if (text.trim()) {
Logger.warn("Network", "Scan error: " + text) Logger.w("Network", "Scan error: " + text)
// If scan fails, retry // If scan fails, retry
delayedScanTimer.interval = 5000 delayedScanTimer.interval = 5000
@@ -491,7 +491,7 @@ Singleton {
root.connecting = false root.connecting = false
root.connectingTo = "" root.connectingTo = ""
Logger.log("Network", `Connected to network: '${connectProcess.ssid}'`) Logger.i("Network", `Connected to network: '${connectProcess.ssid}'`)
ToastService.showNotice(I18n.tr("wifi.panel.title"), I18n.tr("toast.wifi.connected", { ToastService.showNotice(I18n.tr("wifi.panel.title"), I18n.tr("toast.wifi.connected", {
"ssid": connectProcess.ssid "ssid": connectProcess.ssid
})) }))
@@ -520,7 +520,7 @@ Singleton {
root.lastError = text.split("\n")[0].trim() root.lastError = text.split("\n")[0].trim()
} }
Logger.warn("Network", "Connect error: " + text) Logger.w("Network", "Connect error: " + text)
} }
} }
} }
@@ -534,7 +534,7 @@ Singleton {
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
Logger.log("Network", `Disconnected from network: '${disconnectProcess.ssid}'`) Logger.i("Network", `Disconnected from network: '${disconnectProcess.ssid}'`)
ToastService.showNotice(I18n.tr("wifi.panel.title"), I18n.tr("toast.wifi.disconnected", { ToastService.showNotice(I18n.tr("wifi.panel.title"), I18n.tr("toast.wifi.disconnected", {
"ssid": disconnectProcess.ssid "ssid": disconnectProcess.ssid
})) }))
@@ -553,7 +553,7 @@ Singleton {
onStreamFinished: { onStreamFinished: {
root.disconnectingFrom = "" root.disconnectingFrom = ""
if (text.trim()) { if (text.trim()) {
Logger.warn("Network", "Disconnect error: " + text) Logger.w("Network", "Disconnect error: " + text)
} }
// Still trigger a scan even on error // Still trigger a scan even on error
delayedScanTimer.interval = 5000 delayedScanTimer.interval = 5000
@@ -599,8 +599,8 @@ Singleton {
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
Logger.log("Network", `Forget network: "${forgetProcess.ssid}"`) Logger.i("Network", `Forget network: "${forgetProcess.ssid}"`)
Logger.log("Network", text.trim().replace(/[\r\n]/g, " ")) Logger.d("Network", text.trim().replace(/[\r\n]/g, " "))
// Update both cached and existing status immediately // Update both cached and existing status immediately
let nets = root.networks let nets = root.networks
@@ -624,7 +624,7 @@ Singleton {
onStreamFinished: { onStreamFinished: {
root.forgettingNetwork = "" root.forgettingNetwork = ""
if (text.trim() && !text.includes("No profiles found")) { if (text.trim() && !text.includes("No profiles found")) {
Logger.warn("Network", "Forget error: " + text) Logger.w("Network", "Forget error: " + text)
} }
// Still Trigger a scan even on error // Still Trigger a scan even on error
delayedScanTimer.interval = 5000 delayedScanTimer.interval = 5000
+2 -2
View File
@@ -93,10 +93,10 @@ Singleton {
id: runner id: runner
running: false running: false
onStarted: { onStarted: {
Logger.log("NightLight", "Wlsunset started:", runner.command) Logger.i("NightLight", "Wlsunset started:", runner.command)
} }
onExited: function (code, status) { onExited: function (code, status) {
Logger.log("NightLight", "Wlsunset exited:", code, status) Logger.i("NightLight", "Wlsunset exited:", code, status)
} }
} }
} }
+16 -16
View File
@@ -28,7 +28,7 @@ Item {
updateWorkspaces() updateWorkspaces()
updateWindows() updateWindows()
queryDisplayScales() queryDisplayScales()
Logger.log("NiriService", "Initialized successfully") Logger.i("NiriService", "Initialized successfully")
} }
// Update workspaces // Update workspaces
@@ -89,7 +89,7 @@ Item {
CompositorService.onDisplayScalesUpdated(scales) CompositorService.onDisplayScalesUpdated(scales)
} }
} catch (e) { } catch (e) {
Logger.error("NiriService", "Failed to parse outputs:", e, line) Logger.e("NiriService", "Failed to parse outputs:", e, line)
} }
} }
} }
@@ -136,7 +136,7 @@ Item {
workspaceChanged() workspaceChanged()
} catch (e) { } catch (e) {
Logger.error("NiriService", "Failed to parse workspaces:", e, line) Logger.e("NiriService", "Failed to parse workspaces:", e, line)
} }
} }
} }
@@ -154,7 +154,7 @@ Item {
const windowsData = JSON.parse(line) const windowsData = JSON.parse(line)
recollectWindows(windowsData) recollectWindows(windowsData)
} catch (e) { } catch (e) {
Logger.error("NiriService", "Failed to parse windows:", e, line) Logger.e("NiriService", "Failed to parse windows:", e, line)
} }
} }
} }
@@ -193,7 +193,7 @@ Item {
queryDisplayScales() queryDisplayScales()
} }
} catch (e) { } catch (e) {
Logger.error("NiriService", "Error parsing event stream:", e, data) Logger.e("NiriService", "Error parsing event stream:", e, data)
} }
} }
} }
@@ -300,7 +300,7 @@ Item {
windowListChanged() windowListChanged()
} catch (e) { } catch (e) {
Logger.error("NiriService", "Error handling WindowOpenedOrChanged:", e) Logger.e("NiriService", "Error handling WindowOpenedOrChanged:", e)
} }
} }
@@ -324,7 +324,7 @@ Item {
windowListChanged() windowListChanged()
} }
} catch (e) { } catch (e) {
Logger.error("NiriService", "Error handling WindowClosed:", e) Logger.e("NiriService", "Error handling WindowClosed:", e)
} }
} }
@@ -333,7 +333,7 @@ Item {
const windowsData = eventData.windows const windowsData = eventData.windows
recollectWindows(windowsData) recollectWindows(windowsData)
} catch (e) { } catch (e) {
Logger.error("NiriService", "Error handling WindowsChanged:", e) Logger.e("NiriService", "Error handling WindowsChanged:", e)
} }
} }
@@ -359,7 +359,7 @@ Item {
activeWindowChanged() activeWindowChanged()
} catch (e) { } catch (e) {
Logger.error("NiriService", "Error handling WindowFocusChanged:", e) Logger.e("NiriService", "Error handling WindowFocusChanged:", e)
} }
} }
@@ -378,16 +378,16 @@ Item {
windowListChanged() windowListChanged()
} catch (e) { } catch (e) {
Logger.error("NiriService", "Error handling WindowLayoutChanged:", e) Logger.e("NiriService", "Error handling WindowLayoutChanged:", e)
} }
} }
function handleOverviewOpenedOrClosed(eventData) { function handleOverviewOpenedOrClosed(eventData) {
try { try {
overviewActive = eventData.is_open overviewActive = eventData.is_open
Logger.log("NiriService", "Overview opened or closed:", eventData.is_open) Logger.d("NiriService", "Overview opened or closed:", eventData.is_open)
} catch (e) { } catch (e) {
Logger.error("NiriService", "Error handling OverviewOpenedOrClosed:", e) Logger.e("NiriService", "Error handling OverviewOpenedOrClosed:", e)
} }
} }
@@ -396,7 +396,7 @@ Item {
try { try {
Quickshell.execDetached(["niri", "msg", "action", "focus-workspace", workspace.idx.toString()]) Quickshell.execDetached(["niri", "msg", "action", "focus-workspace", workspace.idx.toString()])
} catch (e) { } catch (e) {
Logger.error("NiriService", "Failed to switch workspace:", e) Logger.e("NiriService", "Failed to switch workspace:", e)
} }
} }
@@ -404,7 +404,7 @@ Item {
try { try {
Quickshell.execDetached(["niri", "msg", "action", "focus-window", "--id", window.id.toString()]) Quickshell.execDetached(["niri", "msg", "action", "focus-window", "--id", window.id.toString()])
} catch (e) { } catch (e) {
Logger.error("NiriService", "Failed to switch window:", e) Logger.e("NiriService", "Failed to switch window:", e)
} }
} }
@@ -412,7 +412,7 @@ Item {
try { try {
Quickshell.execDetached(["niri", "msg", "action", "close-window", "--id", window.id.toString()]) Quickshell.execDetached(["niri", "msg", "action", "close-window", "--id", window.id.toString()])
} catch (e) { } catch (e) {
Logger.error("NiriService", "Failed to close window:", e) Logger.e("NiriService", "Failed to close window:", e)
} }
} }
@@ -420,7 +420,7 @@ Item {
try { try {
Quickshell.execDetached(["niri", "msg", "action", "quit", "--skip-confirmation"]) Quickshell.execDetached(["niri", "msg", "action", "quit", "--skip-confirmation"])
} catch (e) { } catch (e) {
Logger.error("NiriService", "Failed to logout:", e) Logger.e("NiriService", "Failed to logout:", e)
} }
} }
} }
+3 -3
View File
@@ -301,7 +301,7 @@ Singleton {
adapter.notifications = items adapter.notifications = items
historyFileView.writeAdapter() historyFileView.writeAdapter()
} catch (e) { } catch (e) {
Logger.error("Notifications", "Save history failed:", e) Logger.e("Notifications", "Save history failed:", e)
} }
} }
@@ -331,7 +331,7 @@ Singleton {
}) })
} }
} catch (e) { } catch (e) {
Logger.error("Notifications", "Load failed:", e) Logger.e("Notifications", "Load failed:", e)
} }
} }
@@ -461,7 +461,7 @@ Singleton {
try { try {
Quickshell.execDetached(["sh", "-c", `rm -rf "${Settings.cacheDirImagesNotifications}"*`]) Quickshell.execDetached(["sh", "-c", `rm -rf "${Settings.cacheDirImagesNotifications}"*`])
} catch (e) { } catch (e) {
Logger.error("Notifications", "Failed to clear cache directory:", e) Logger.e("Notifications", "Failed to clear cache directory:", e)
} }
historyList.clear() historyList.clear()
+1 -1
View File
@@ -24,7 +24,7 @@ Singleton {
// Register this panel // Register this panel
function registerPanel(panel) { function registerPanel(panel) {
registeredPanels[panel.objectName] = panel registeredPanels[panel.objectName] = panel
Logger.log("PanelService", "Registered:", panel.objectName) Logger.d("PanelService", "Registered:", panel.objectName)
} }
// Returns a panel // Returns a panel
+1 -1
View File
@@ -55,7 +55,7 @@ Singleton {
try { try {
powerProfiles.profile = p powerProfiles.profile = p
} catch (e) { } catch (e) {
Logger.error("PowerProfileService", "Failed to set profile:", e) Logger.e("PowerProfileService", "Failed to set profile:", e)
} }
} }
+6 -6
View File
@@ -65,12 +65,12 @@ Singleton {
} }
} }
Logger.log("ProgramChecker", "Detected Discord clients:", detectedClients.join(", ")) Logger.i("ProgramChecker", "Detected Discord clients:", detectedClients.join(", "))
} }
} }
if (availableDiscordClients.length === 0) { if (availableDiscordClients.length === 0) {
Logger.log("ProgramChecker", "No Discord clients detected") Logger.d("ProgramChecker", "No Discord clients detected")
} }
} }
@@ -161,7 +161,7 @@ Singleton {
// Function to check a specific program // Function to check a specific program
function checkProgram(programProperty) { function checkProgram(programProperty) {
if (!programsToCheck.hasOwnProperty(programProperty)) { if (!programsToCheck.hasOwnProperty(programProperty)) {
Logger.warn("ProgramChecker", "Unknown program property:", programProperty) Logger.w("ProgramChecker", "Unknown program property:", programProperty)
return return
} }
@@ -172,14 +172,14 @@ Singleton {
// Manual function to test Discord detection (for debugging) // Manual function to test Discord detection (for debugging)
function testDiscordDetection() { function testDiscordDetection() {
Logger.log("ProgramChecker", "Testing Discord detection...") Logger.d("ProgramChecker", "Testing Discord detection...")
Logger.log("ProgramChecker", "HOME:", Quickshell.env("HOME")) Logger.d("ProgramChecker", "HOME:", Quickshell.env("HOME"))
// Test each client directory // Test each client directory
for (var i = 0; i < MatugenTemplates.discordClients.length; i++) { for (var i = 0; i < MatugenTemplates.discordClients.length; i++) {
var client = MatugenTemplates.discordClients[i] var client = MatugenTemplates.discordClients[i]
var configDir = client.configPath.replace("~", Quickshell.env("HOME")) var configDir = client.configPath.replace("~", Quickshell.env("HOME"))
Logger.log("ProgramChecker", "Checking:", configDir) Logger.d("ProgramChecker", "Checking:", configDir)
} }
detectDiscordClient() detectDiscordClient()
+10 -10
View File
@@ -43,9 +43,9 @@ Item {
queryDisplayScales() queryDisplayScales()
}) })
initialized = true initialized = true
Logger.log("SwayService", "Initialized successfully") Logger.i("SwayService", "Initialized successfully")
} catch (e) { } catch (e) {
Logger.error("SwayService", "Failed to initialize:", e) Logger.e("SwayService", "Failed to initialize:", e)
} }
} }
@@ -70,7 +70,7 @@ Item {
onExited: function (exitCode) { onExited: function (exitCode) {
if (exitCode !== 0 || !accumulatedOutput) { if (exitCode !== 0 || !accumulatedOutput) {
Logger.error("SwayService", "Failed to query outputs, exit code:", exitCode) Logger.e("SwayService", "Failed to query outputs, exit code:", exitCode)
accumulatedOutput = "" accumulatedOutput = ""
return return
} }
@@ -101,7 +101,7 @@ Item {
CompositorService.onDisplayScalesUpdated(scales) CompositorService.onDisplayScalesUpdated(scales)
} }
} catch (e) { } catch (e) {
Logger.error("SwayService", "Failed to parse outputs:", e) Logger.e("SwayService", "Failed to parse outputs:", e)
} finally { } finally {
// Clear accumulated output for next query // Clear accumulated output for next query
accumulatedOutput = "" accumulatedOutput = ""
@@ -147,7 +147,7 @@ Item {
workspaces.append(wsData) workspaces.append(wsData)
} }
} catch (e) { } catch (e) {
Logger.error("SwayService", "Error updating workspaces:", e) Logger.e("SwayService", "Error updating workspaces:", e)
} }
} }
@@ -187,7 +187,7 @@ Item {
activeWindowChanged() activeWindowChanged()
} }
} catch (e) { } catch (e) {
Logger.error("SwayService", "Error updating windows:", e) Logger.e("SwayService", "Error updating windows:", e)
} }
} }
@@ -272,7 +272,7 @@ Item {
try { try {
workspace.handle.activate() workspace.handle.activate()
} catch (e) { } catch (e) {
Logger.error("SwayService", "Failed to switch workspace:", e) Logger.e("SwayService", "Failed to switch workspace:", e)
} }
} }
@@ -280,7 +280,7 @@ Item {
try { try {
window.handle.activate() window.handle.activate()
} catch (e) { } catch (e) {
Logger.error("SwayService", "Failed to switch window:", e) Logger.e("SwayService", "Failed to switch window:", e)
} }
} }
@@ -288,7 +288,7 @@ Item {
try { try {
window.handle.close() window.handle.close()
} catch (e) { } catch (e) {
Logger.error("SwayService", "Failed to close window:", e) Logger.e("SwayService", "Failed to close window:", e)
} }
} }
@@ -296,7 +296,7 @@ Item {
try { try {
Quickshell.execDetached(["swaymsg", "exit"]) Quickshell.execDetached(["swaymsg", "exit"])
} catch (e) { } catch (e) {
Logger.error("SwayService", "Failed to logout:", e) Logger.e("SwayService", "Failed to logout:", e)
} }
} }
} }
+6 -6
View File
@@ -42,7 +42,7 @@ Singleton {
// -------------------------------------------- // --------------------------------------------
Component.onCompleted: { Component.onCompleted: {
Logger.log("SystemStat", "Service started with interval:", root.sleepDuration, "ms") Logger.i("SystemStat", "Service started with interval:", root.sleepDuration, "ms")
// Kickoff the cpu name detection for temperature // Kickoff the cpu name detection for temperature
cpuTempNameReader.checkNext() cpuTempNameReader.checkNext()
@@ -121,11 +121,11 @@ Singleton {
function checkNext() { function checkNext() {
if (currentIndex >= 16) { if (currentIndex >= 16) {
// Check up to hwmon10 // Check up to hwmon10
Logger.warn("No supported temperature sensor found") Logger.w("No supported temperature sensor found")
return return
} }
//Logger.log("SystemStat", "---- Probing: hwmon", currentIndex) //Logger.i("SystemStat", "---- Probing: hwmon", currentIndex)
cpuTempNameReader.path = `/sys/class/hwmon/hwmon${currentIndex}/name` cpuTempNameReader.path = `/sys/class/hwmon/hwmon${currentIndex}/name`
cpuTempNameReader.reload() cpuTempNameReader.reload()
} }
@@ -135,7 +135,7 @@ Singleton {
if (root.supportedTempCpuSensorNames.includes(name)) { if (root.supportedTempCpuSensorNames.includes(name)) {
root.cpuTempSensorName = name root.cpuTempSensorName = name
root.cpuTempHwmonPath = `/sys/class/hwmon/hwmon${currentIndex}` root.cpuTempHwmonPath = `/sys/class/hwmon/hwmon${currentIndex}`
Logger.log("SystemStat", `Found ${root.cpuTempSensorName} CPU thermal sensor at ${root.cpuTempHwmonPath}`) Logger.i("SystemStat", `Found ${root.cpuTempSensorName} CPU thermal sensor at ${root.cpuTempHwmonPath}`)
} else { } else {
currentIndex++ currentIndex++
Qt.callLater(() => { Qt.callLater(() => {
@@ -386,9 +386,9 @@ Singleton {
sum += root.intelTempValues[i] sum += root.intelTempValues[i]
} }
root.cpuTemp = Math.round(sum / root.intelTempValues.length) root.cpuTemp = Math.round(sum / root.intelTempValues.length)
//Logger.log("SystemStat", `Averaged ${root.intelTempValues.length} CPU thermal sensors: ${root.cpuTemp}°C`) //Logger.i("SystemStat", `Averaged ${root.intelTempValues.length} CPU thermal sensors: ${root.cpuTemp}°C`)
} else { } else {
Logger.warn("SystemStat", "No temperature sensors found for coretemp") Logger.w("SystemStat", "No temperature sensors found for coretemp")
root.cpuTemp = 0 root.cpuTemp = 0
} }
return return
+2 -2
View File
@@ -22,7 +22,7 @@ Singleton {
// Don't create if no text // Don't create if no text
if (!screen || !target || !text) { if (!screen || !target || !text) {
Logger.log("Tooltip", "No target or text") Logger.i("Tooltip", "No target or text")
return return
} }
@@ -82,7 +82,7 @@ Singleton {
return newTooltip return newTooltip
} else { } else {
Logger.error("Tooltip", "Failed to create tooltip instance") Logger.e("Tooltip", "Failed to create tooltip instance")
} }
return null return null
+2 -2
View File
@@ -20,11 +20,11 @@ Singleton {
function checkForUpdates() { function checkForUpdates() {
// TODO: Implement update checking logic // TODO: Implement update checking logic
Logger.log("UpdateService", "Checking for updates...") Logger.i("UpdateService", "Checking for updates...")
} }
function init() { function init() {
// Ensure the singleton is created // Ensure the singleton is created
Logger.log("UpdateService", "Version:", root.currentVersion) Logger.i("UpdateService", "Version:", root.currentVersion)
} }
} }
+7 -7
View File
@@ -76,7 +76,7 @@ Singleton {
// ------------------------------------------------- // -------------------------------------------------
function init() { function init() {
Logger.log("Wallpaper", "Service started") Logger.i("Wallpaper", "Service started")
translateModels() translateModels()
@@ -247,11 +247,11 @@ Singleton {
} }
if (screenName === undefined) { if (screenName === undefined) {
Logger.warn("Wallpaper", "setWallpaper", "no screen specified") Logger.w("Wallpaper", "setWallpaper", "no screen specified")
return return
} }
//Logger.log("Wallpaper", "setWallpaper on", screenName, ": ", path) //Logger.i("Wallpaper", "setWallpaper on", screenName, ": ", path)
// Check if wallpaper actually changed // Check if wallpaper actually changed
var oldPath = currentWallpapers[screenName] || "" var oldPath = currentWallpapers[screenName] || ""
@@ -303,7 +303,7 @@ Singleton {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
function setRandomWallpaper() { function setRandomWallpaper() {
Logger.log("Wallpaper", "setRandomWallpaper") Logger.d("Wallpaper", "setRandomWallpaper")
if (Settings.data.wallpaper.enableMultiMonitorDirectories) { if (Settings.data.wallpaper.enableMultiMonitorDirectories) {
// Pick a random wallpaper per screen // Pick a random wallpaper per screen
@@ -331,7 +331,7 @@ Singleton {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
function toggleRandomWallpaper() { function toggleRandomWallpaper() {
Logger.log("Wallpaper", "toggleRandomWallpaper") Logger.d("Wallpaper", "toggleRandomWallpaper")
if (Settings.data.wallpaper.randomEnabled) { if (Settings.data.wallpaper.randomEnabled) {
restartRandomWallpaperTimer() restartRandomWallpaperTimer()
setRandomWallpaper() setRandomWallpaper()
@@ -355,7 +355,7 @@ Singleton {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
function refreshWallpapersList() { function refreshWallpapersList() {
Logger.log("Wallpaper", "refreshWallpapersList") Logger.d("Wallpaper", "refreshWallpapersList")
scanningCount = 0 scanningCount = 0
// Force refresh by toggling the folder property on each FolderListModel // Force refresh by toggling the folder property on each FolderListModel
@@ -429,7 +429,7 @@ Singleton {
root.wallpaperLists[screenName] = files root.wallpaperLists[screenName] = files
scanningCount-- scanningCount--
Logger.log("Wallpaper", "List refreshed for", screenName, "count:", files.length) Logger.d("Wallpaper", "List refreshed for", screenName, "count:", files.length)
root.wallpaperListChanged(screenName, files.length) root.wallpaperListChanged(screenName, files.length)
} }
} }
+1 -1
View File
@@ -16,7 +16,7 @@ Text {
return "" return ""
} }
if (Icons.get(icon) === undefined) { if (Icons.get(icon) === undefined) {
Logger.warn("Icon", `"${icon}"`, "doesn't exist in the icons font") Logger.w("Icon", `"${icon}"`, "doesn't exist in the icons font")
Logger.callStack() Logger.callStack()
return Icons.get(Icons.defaultIcon) return Icons.get(Icons.defaultIcon)
} }
+1 -1
View File
@@ -23,7 +23,7 @@ Image {
onImagePathChanged: { onImagePathChanged: {
if (imagePath) { if (imagePath) {
imageHash = Checksum.sha256(imagePath) imageHash = Checksum.sha256(imagePath)
// Logger.log("NImageCached", imagePath, imageHash) // Logger.i("NImageCached", imagePath, imageHash)
} else { } else {
source = "" source = ""
imageHash = "" imageHash = ""
+2 -2
View File
@@ -135,7 +135,7 @@ Loader {
readonly property real verticalBarWidth: Style.barHeight readonly property real verticalBarWidth: Style.barHeight
Component.onCompleted: { Component.onCompleted: {
Logger.log("NPanel", "Opened", root.objectName, "on", screen.name) Logger.d("NPanel", "Opened", root.objectName, "on", screen.name)
dimmingOpacity = Style.opacityHeavy dimmingOpacity = Style.opacityHeavy
} }
@@ -148,7 +148,7 @@ Loader {
if (buttonName) { if (buttonName) {
setPosition() setPosition()
} }
Logger.log("NPanel", "OnScreenChanged", root.screen.name) Logger.d("NPanel", "OnScreenChanged", root.screen.name)
} }
} }
+3 -3
View File
@@ -285,19 +285,19 @@ NBox {
if (dialog) { if (dialog) {
dialog.open() dialog.open()
} else { } else {
Logger.error("NSectionEditor", "Failed to create settings dialog instance") Logger.e("NSectionEditor", "Failed to create settings dialog instance")
} }
} }
if (component.status === Component.Ready) { if (component.status === Component.Ready) {
instantiateAndOpen() instantiateAndOpen()
} else if (component.status === Component.Error) { } else if (component.status === Component.Error) {
Logger.error("NSectionEditor", component.errorString()) Logger.e("NSectionEditor", component.errorString())
} else { } else {
component.statusChanged.connect(function () { component.statusChanged.connect(function () {
if (component.status === Component.Ready) { if (component.status === Component.Ready) {
instantiateAndOpen() instantiateAndOpen()
} else if (component.status === Component.Error) { } else if (component.status === Component.Error) {
Logger.error("NSectionEditor", component.errorString()) Logger.e("NSectionEditor", component.errorString())
} }
}) })
} }
+3 -3
View File
@@ -49,8 +49,8 @@ ShellRoot {
property bool settingsLoaded: false property bool settingsLoaded: false
Component.onCompleted: { Component.onCompleted: {
Logger.log("Shell", "---------------------------") Logger.i("Shell", "---------------------------")
Logger.log("Shell", "Noctalia Hello!") Logger.i("Shell", "Noctalia Hello!")
} }
Connections { Connections {
@@ -79,7 +79,7 @@ ShellRoot {
sourceComponent: Item { sourceComponent: Item {
Component.onCompleted: { Component.onCompleted: {
Logger.log("Shell", "---------------------------") Logger.i("Shell", "---------------------------")
WallpaperService.init() WallpaperService.init()
AppThemeService.init() AppThemeService.init()
ColorSchemeService.init() ColorSchemeService.init()