From 65444b6d255486a268ca996f46bb999e6f14de21 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 26 Mar 2025 18:04:12 +0000 Subject: [PATCH] fix(daemon): Adjust console log box formatting for consistent output in daemon status messages --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/daemon.ts | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index 22ca2aa..e3351f2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-03-26 - 2.6.10 - fix(daemon) +Adjust console log box formatting for consistent output in daemon status messages + +- Updated closing box borders to align properly in configuration error, periodic updates, and UPS status logs +- Improved visual consistency in log messages + ## 2025-03-26 - 2.6.9 - fix(cli) Improve console output formatting for status banners and logging messages diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index c0cd08e..541254c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/nupst', - version: '2.6.9', + version: '2.6.10', description: 'Node.js UPS Shutdown Tool for SNMP-enabled UPS devices' } diff --git a/ts/daemon.ts b/ts/daemon.ts index b513fa8..0e8f60f 100644 --- a/ts/daemon.ts +++ b/ts/daemon.ts @@ -125,7 +125,7 @@ export class NupstDaemon { console.error('┌─ Configuration Error ─────────────────────┐'); console.error(`│ ${message}`); console.error('│ Please run \'nupst setup\' first to create a configuration.'); - console.error('└──────────────────────────────────────────┘'); + console.error('└───────────────────────────────────────────┘'); } /** @@ -196,7 +196,7 @@ export class NupstDaemon { console.log(`│ Battery: ${this.config.thresholds.battery}%`); console.log(`│ Runtime: ${this.config.thresholds.runtime} minutes`); console.log(`│ Check Interval: ${this.config.checkInterval / 1000} seconds`); - console.log('└──────────────────────────────────────────┘'); + console.log('└────────────────────────────────────────────┘'); } /** @@ -228,7 +228,7 @@ export class NupstDaemon { if (status.powerStatus !== lastStatus) { console.log('┌─ Power Status Change ─────────────────────┐'); console.log(`│ Status changed: ${lastStatus} → ${status.powerStatus}`); - console.log('└──────────────────────────────────────────┘'); + console.log('└───────────────────────────────────────────┘'); lastStatus = status.powerStatus; lastLogTime = currentTime; // Reset log timer when status changes } @@ -239,7 +239,7 @@ export class NupstDaemon { console.log(`│ Timestamp: ${timestamp}`); console.log(`│ Power Status: ${status.powerStatus}`); console.log(`│ Battery: ${status.batteryCapacity}% | Runtime: ${status.batteryRuntime} min`); - console.log('└──────────────────────────────────────────┘'); + console.log('└───────────────────────────────────────────┘'); lastLogTime = currentTime; } @@ -267,7 +267,7 @@ export class NupstDaemon { batteryCapacity: number, batteryRuntime: number }): Promise { - console.log('┌─ UPS Status ────────────────────────────┐'); + console.log('┌─ UPS Status ─────────────────────────────┐'); console.log(`│ Battery: ${status.batteryCapacity}% | Runtime: ${status.batteryRuntime} min`); console.log('└──────────────────────────────────────────┘');