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

meta: log level re-work

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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