fix(electron): reduce idle detection log verbosity

Change frequent idle check logs from info to debug level to prevent
polluting system logs (e.g., /var/log/syslog) every 5 seconds.

Closes #5794
This commit is contained in:
Johannes Millan 2025-12-31 13:42:18 +01:00
parent 1529920c37
commit 62d449a82f
2 changed files with 8 additions and 8 deletions

View file

@ -63,7 +63,7 @@ export class IdleTimeHandler {
gnomeShellSession,
};
log.info('Environment detection:', environment);
log.debug('Environment detection:', environment);
return environment;
}
@ -138,22 +138,22 @@ export class IdleTimeHandler {
}
private async _determineWorkingMethod(): Promise<IdleDetectionMethod> {
log.info('Determining idle detection method...');
log.debug('Determining idle detection method...');
if (!this._environment.isWayland) {
log.info('Using powerMonitor for non-Wayland session');
log.debug('Using powerMonitor for non-Wayland session');
return 'powerMonitor';
}
for (const candidate of this._buildWaylandCandidates()) {
log.info(`Testing ${candidate.name}...`);
log.debug(`Testing ${candidate.name}...`);
try {
const works = await candidate.test();
if (works) {
log.info(`Selected ${candidate.name} for idle detection`);
return candidate.name;
}
log.info(`${candidate.name} test failed`);
log.debug(`${candidate.name} test failed`);
} catch (error) {
log.warn(`${candidate.name} test error`, error);
}
@ -177,7 +177,7 @@ export class IdleTimeHandler {
return idleTime !== null;
} catch (error) {
if (this._environment.isSnap) {
log.info('GNOME DBus test failed in snap environment', error);
log.debug('GNOME DBus test failed in snap environment', error);
}
return false;
}
@ -198,7 +198,7 @@ export class IdleTimeHandler {
});
if (this._environment.isSnap) {
log.info('Skipping loginctl in snap environment');
log.debug('Skipping loginctl in snap environment');
} else {
candidates.push({
name: 'loginctl',

View file

@ -233,7 +233,7 @@ export const startApp = (): void => {
`threshold=${CONFIG.MIN_IDLE_TIME}ms`,
`action=${actionSummary}`,
];
log(`🕘 Idle check (${logParts.join(', ')})`);
electronLog.debug(`🕘 Idle check (${logParts.join(', ')})`);
} catch (error) {
consecutiveFailures += 1;
log('💥 Error getting idle time, falling back to powerMonitor:', error);