mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Using a custom logger with colors and timestamp instead of console.xxx
This commit is contained in:
@@ -156,13 +156,13 @@ Singleton {
|
||||
readonly property Process initProc: Process {
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
console.log("[Brightness] Raw brightness data for", monitor.modelData.name + ":", text.trim())
|
||||
Logger.log("Brightness", "Raw brightness data for", monitor.modelData.name + ":", text.trim())
|
||||
|
||||
if (monitor.isAppleDisplay) {
|
||||
var val = parseInt(text.trim())
|
||||
if (!isNaN(val)) {
|
||||
monitor.brightness = val / 101
|
||||
console.log("[Brightness] Apple display brightness:", monitor.brightness)
|
||||
Logger.log("Brightness", "Apple display brightness:", monitor.brightness)
|
||||
}
|
||||
} else if (monitor.isDdc) {
|
||||
var parts = text.trim().split(" ")
|
||||
@@ -171,7 +171,7 @@ Singleton {
|
||||
var max = parseInt(parts[1])
|
||||
if (!isNaN(current) && !isNaN(max) && max > 0) {
|
||||
monitor.brightness = current / max
|
||||
console.log("[Brightness] DDC brightness:", current + "/" + max + " =", monitor.brightness)
|
||||
Logger.log("Brightness", "DDC brightness:", current + "/" + max + " =", monitor.brightness)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -182,7 +182,7 @@ Singleton {
|
||||
var max = parseInt(parts[1])
|
||||
if (!isNaN(current) && !isNaN(max) && max > 0) {
|
||||
monitor.brightness = current / max
|
||||
console.log("[Brightness] Internal brightness:", current + "/" + max + " =", monitor.brightness)
|
||||
Logger.log("Brightness", "Internal brightness:", current + "/" + max + " =", monitor.brightness)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user