Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/log_level_cfg #252

Merged
merged 3 commits into from
Jun 18, 2024
Merged

fix/log_level_cfg #252

merged 3 commits into from
Jun 18, 2024

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Jun 17, 2024

react to changes in log level from mycroft.conf

closes OpenVoiceOS/ovos-config#125

to test change level between info and debug, and confirm in services that it is respected

  "logging": {
    "log_level": "DEBUG"
  },
(NOTICE debug log)
-06-19 00:12:02.968 - skills - ovos_config.config:_on_file_change:312 - DEBUG - Calling 1 callbacks
2024-06-19 00:12:02.970 - skills - ovos_utils.log:_monitor_log_level:202 - INFO - updated LOG level

(NOTICE only INFO afterwards)

2024-06-19 00:12:08.765 - skills - padacioso:calc_intent:240 - INFO - No match
2024-06-19 00:12:08.768 - skills - ovos_core.intent_services.commonqa_service:match:109 - INFO - Gathering answers from skills: ['ovos-skill-fakewiki.openvoiceos']
2024-06-19 00:12:08.776 - skills - ovos_core.intent_services.ocp_service:is_ocp_query:1113 - INFO - OVOSCommonPlay prediction: OCP confidence: 0.944
2024-06-19 00:12:08.789 - skills - ovos_core.intent_services.ocp_service:classify_media:1086 - INFO - OVOSCommonPlay MediaType prediction: music confidence: 0.638
2024-06-19 00:12:17.783 - skills - ovos_config.config:_on_file_change:311 - INFO - /home/miro/.config/mycroft/mycroft.conf changed on disk
2024-06-19 00:12:17.787 - skills - ovos_utils.log:_monitor_log_level:202 - INFO - updated LOG level

(NOTICE debug logs again)

2024-06-19 00:12:22.319 - skills - ovos_core.transformers:transform:64 - DEBUG - ovos-utterance-cancel: {}
2024-06-19 00:12:22.321 - skills - ovos_core.transformers:transform:64 - DEBUG - ovos-utterance-normalizer: {'lang': 'en-us'}

react to changes in log level from mycroft.conf
@JarbasAl JarbasAl added the bug Something isn't working label Jun 17, 2024
@JarbasAl JarbasAl requested review from goldyfruit, NeonDaniel and a team June 17, 2024 23:05
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 24 lines in your changes missing coverage. Please review.

Project coverage is 42.34%. Comparing base (1dbb348) to head (a9c9d4f).
Report is 1 commits behind head on dev.

Files Patch % Lines
ovos_utils/log.py 20.00% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #252      +/-   ##
==========================================
- Coverage   42.40%   42.34%   -0.07%     
==========================================
  Files          31       31              
  Lines        3127     3148      +21     
==========================================
+ Hits         1326     1333       +7     
- Misses       1801     1815      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NeonDaniel
Copy link
Member

Can you add some trivial unit test coverage that config changes are reacted to? (i.e. no reload if non-log config changed vs log re-init upon relevant config change). This should also resolve the failing codecov test

@JarbasAl
Copy link
Member Author

the file watcher is tested here https://github.com/OpenVoiceOS/ovos-utils/blob/dev/test/unittests/test_file_utils.py#L56

and the config watcher itself is used in other services (audio and listener) and tested here https://github.com/OpenVoiceOS/ovos-config/blob/dev/test/unittests/test_configuration.py#L182

@JarbasAl JarbasAl marked this pull request as draft June 18, 2024 23:08
@JarbasAl
Copy link
Member Author

while this does react to file changes properly etc, the change in log level does not actually take effect when calling LOG.init(_logs_conf) , need to investigate further

@JarbasAl JarbasAl marked this pull request as ready for review June 18, 2024 23:15
@JarbasAl JarbasAl merged commit d87b749 into dev Jun 18, 2024
8 of 9 checks passed
@JarbasAl JarbasAl deleted the fix/log_level_cfg branch June 18, 2024 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

log_level change should be handles by services
2 participants