elad-bar / ha-shinobi

Shinobi Video custom component for HA
53 stars 5 forks source link

[FR] Change log level #29

Closed chemelli74 closed 2 years ago

chemelli74 commented 2 years ago

Hi,

would be possibile to move the following log line from "INFO" to "DEBUG" log level ?

2022-07-22 05:38:03 INFO (MainThread) [custom_components.shinobi.component.api.shinobi_api] Updating data from Shinobi Video Server (Shinobi Video)

Just to keep the log at a decent size and avoid spamming. Thank you in advance for considering my request.

Simone

elad-bar commented 2 years ago

Hi,

Sure, but the question is why? This is a crucial action to make sure device is being synced, it doesn't contain any transportation data but the action being performed and used as opposed to debug messages that allows to debug by adding the transportation data between classes and API.

Thanks

chemelli74 commented 2 years ago

Hi,

Sure, but the question is why?

Because it spams the log as every minute you have a line for it. And it grows a lot if you leave HA running for weeks.

This is a crucial action to make sure device is being synced, it doesn't contain any transportation data but the action being > performed and used as opposed to debug messages that allows to debug by adding the transportation data between classes and API.

I think the normal behavior should be to log warning (for example slow updates) or errors (for example failed updates) but a standard behavior message should not be so interesting in everyday life. Instead is important if you need to debug a misbehavior, so I suggested to move it to another level and not at all to remove it.

Hope it's more clear and it makes sense for you as well. Thank you,

Simone

elad-bar commented 2 years ago

Default configuration if HA is Warning for a reason, if you would like to raise the log level you should set the specific component to INFO or DEBUG, INFO and DEBUG are to document an action performed successfully, debug allows you to view the underlying data of the action, Using just warning to inform that an action failed will make error and debug as redundant

Thanks

chemelli74 commented 2 years ago

I understand you want to leave the component as it is. Ok, no problem. Feel free to close this request.

Just take care that is the only one behaving like that. Many users leave the default logging level as INFO and so do I.

Best regards,

Simone

elad-bar commented 2 years ago

Not trying to argue, but... according to HA, default is debug if you set the integration without log level parameter, if you didn't set the logger integration it will be warning and above

The log severity level is warning if the logger integration is not enabled in configuration.yaml.

Taken from https://www.home-assistant.io/integrations/logger/

Anyway, thanks for the suggestion, will consider it for next release