petro-kushchak / homebridge-homepod-radio

MIT License
39 stars 2 forks source link

Simplify logging entries #58

Open justjam2013 opened 1 month ago

justjam2013 commented 1 month ago

Current condition

The Homebridge logs are filled by log entries from homebridge homepod radio:

[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [Stream Greeting Switch] SET ON: true
[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [HomePod Radio] Stopping playback - received stop request from Play Wakeup Greeting MiniPod B 
[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [HomePod Radio] Skipped storing state
[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [Stream Greeting] Started hearbeat null
[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [Stream Greeting] Started file streaming /media/greeting.wav
[10/16/2024, 9:32:34 AM] [HomepodRadioPlatform] [Stream Greeting] streaming exit: code 0 signal null
[10/16/2024, 9:32:34 AM] [HomepodRadioPlatform] [Stream Greeting] Cleared hearbeat null - stop requested
[10/16/2024, 9:32:34 AM] [HomepodRadioPlatform] [Stream Greeting] Error while trying to stop: Error: Command failed: kill -9 336008
/bin/sh: 1: kill: No such process

[10/16/2024, 9:34:21 AM] [HomepodRadioPlatform] [Stream Greeting Switch] GET ON
[10/16/2024, 9:47:55 AM] [HomepodRadioPlatform] [Stream Greeting Switch] GET ON
[10/16/2024, 3:03:04 PM] [HomepodRadioPlatform] [Stream Greeting Switch] GET ON
[10/16/2024, 3:08:53 PM] [HomepodRadioPlatform] [Stream Greeting Switch] GET ON
[10/16/2024, 9:00:57 PM] [HomepodRadioPlatform] [Stream Greeting Switch] GET ON
[10/16/2024, 9:26:42 PM] [HomepodRadioPlatform] [Stream Greeting Switch] GET ON

This is causing a lot of noise in the logs.

Suggested solution

Change the logging of GETs:

[10/16/2024, 9:26:42 PM] [HomepodRadioPlatform] [Stream Greeting Switch] GET ON

from info to debug entries.

Reduce the following logging:

[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [Stream Greeting Switch] SET ON: true
[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [HomePod Radio] Stopping playback - received stop request from Play Wakeup Greeting MiniPod B 
[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [HomePod Radio] Skipped storing state
[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [Stream Greeting] Started hearbeat null
[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [Stream Greeting] Started file streaming /media/greeting.wav
[10/16/2024, 9:32:34 AM] [HomepodRadioPlatform] [Stream Greeting] streaming exit: code 0 signal null
[10/16/2024, 9:32:34 AM] [HomepodRadioPlatform] [Stream Greeting] Cleared hearbeat null - stop requested

to just:

[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [Stream Greeting Switch] SET ON: true
[10/16/2024, 9:31:28 AM] [HomepodRadioPlatform] [Stream Greeting] Started file streaming /media/greeting.wav

by moving the rest to debug log entries.

I have opened a separate issue to address this log entry here

[10/16/2024, 9:32:34 AM] [HomepodRadioPlatform] [Stream Greeting] Error while trying to stop: Error: Command failed: kill -9 336008
/bin/sh: 1: kill: No such process

Additional solution

Add a debug checkbox to the plugin config, to display the additional entries, if needed.