-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[configurator] Expose log level env variable #3845
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request introduce a new version, 5.8.1, for the configurator, which includes the feature of a configurable log level. The documentation and configuration files have been updated to reflect this new option, allowing users to specify their desired logging verbosity. The updates also include a new environment variable in the script that manages logging behavior. The overall structure of the documentation and configuration files remains largely unchanged, focusing on enhancing user control over logging settings. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (2)
configurator/translations/en.yaml (1)
28-31
: Enhance the log level descriptionThe addition of the log level configuration option is good, but the description could be more helpful to users.
Consider expanding the description to be more informative:
loglevel: name: Log level description: >- - The log level to use (default `info`). + Specify the logging verbosity. Available levels from most to least verbose: + `debug`, `info` (default), `warning`, `error`, `critical`. Setting a higher + level reduces log output. For example, `warning` will only show warning and + error messages.configurator/CHANGELOG.md (1)
3-5
: Enhance the changelog entry with more specific details.The changelog entry is clear but could be more informative. Consider expanding it to include the default value and available options:
## 5.8.1 -Expose configurable log level +Expose configurable log level (default: 'info', options: debug/info/warning/error/critical)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
configurator/CHANGELOG.md
(1 hunks)configurator/DOCS.md
(1 hunks)configurator/config.yaml
(3 hunks)configurator/rootfs/etc/s6-overlay/s6-rc.d/configurator/run
(2 hunks)configurator/translations/en.yaml
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
configurator/CHANGELOG.md (6)
Pattern */**(html|markdown|md)
: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.
- Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
- In step-by-step instructions, front the location phrase in the instructional sentence.
- In step-by-step instructions, front the 'goal' in the instructional sentence.
- In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
- do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'
Pattern */**(html|markdown|md)
: - Use bold to mark UI strings.
- If "" are used to mark UI strings, replace them by bold.
Pattern */**(html|markdown|md)
: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
Pattern */**(html|markdown|md)
: - Use sentence-style capitalization also in headings.
Pattern */**(html|markdown|md)
: do not comment on HTML used for icons
Pattern */**(html|markdown|md)
: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
configurator/DOCS.md (6)
Pattern */**(html|markdown|md)
: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.
- Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
- In step-by-step instructions, front the location phrase in the instructional sentence.
- In step-by-step instructions, front the 'goal' in the instructional sentence.
- In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
- do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'
Pattern */**(html|markdown|md)
: - Use bold to mark UI strings.
- If "" are used to mark UI strings, replace them by bold.
Pattern */**(html|markdown|md)
: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
Pattern */**(html|markdown|md)
: - Use sentence-style capitalization also in headings.
Pattern */**(html|markdown|md)
: do not comment on HTML used for icons
Pattern */**(html|markdown|md)
: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
configurator/config.yaml (6)
Pattern */**(html|markdown|md)
: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.
- Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
- In step-by-step instructions, front the location phrase in the instructional sentence.
- In step-by-step instructions, front the 'goal' in the instructional sentence.
- In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
- do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'
Pattern */**(html|markdown|md)
: - Use bold to mark UI strings.
- If "" are used to mark UI strings, replace them by bold.
Pattern */**(html|markdown|md)
: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
Pattern */**(html|markdown|md)
: - Use sentence-style capitalization also in headings.
Pattern */**(html|markdown|md)
: do not comment on HTML used for icons
Pattern */**(html|markdown|md)
: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
🔇 Additional comments (4)
configurator/config.yaml (2)
2-2
: LGTM: Version bump follows semantic versioning
The minor version increment is appropriate for adding a new configuration option.
46-46
: LGTM: Log level schema is well-defined
The schema correctly defines the standard Python logging levels in order of verbosity, ensuring type safety through enumeration.
configurator/rootfs/etc/s6-overlay/s6-rc.d/configurator/run (2)
10-10
: LGTM! Export declaration follows established patterns
The HC_LOGLEVEL export declaration is consistent with other environment variable exports and follows the existing naming convention.
Line range hint 10-36
: Verify configurator's handling of HC_LOGLEVEL
Let's ensure that:
- The configurator code actually uses this environment variable
- The documentation properly explains the available log levels
✅ Verification successful
Let me check the actual content of these files to verify how HC_LOGLEVEL is used and documented.
HC_LOGLEVEL implementation is properly documented and configured
The verification shows that:
- The
loglevel
option is well documented in DOCS.md with a clear description - The config schema correctly defines allowed values: debug, info, warning, error, critical
- The option is properly translated in en.yaml with a clear name and description
- The environment variable HC_LOGLEVEL is exported and set with the configured value, defaulting to 'info'
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if configurator code references HC_LOGLEVEL
rg -l "HC_LOGLEVEL|loglevel" configurator/
# Check if documentation mentions the new option
rg -l "loglevel" configurator/DOCS.md configurator/config.yaml configurator/CHANGELOG.md
Length of output: 319
Script:
#!/bin/bash
# Check the documentation of loglevel
echo "=== DOCS.md ==="
rg -A 5 "loglevel" configurator/DOCS.md
echo -e "\n=== config.yaml ==="
rg -A 5 "loglevel" configurator/config.yaml
echo -e "\n=== translations/en.yaml ==="
rg -A 5 "loglevel" configurator/translations/en.yaml
echo -e "\n=== Looking for HC_LOGLEVEL usage in configurator ==="
rg "HC_LOGLEVEL" configurator/
Length of output: 1122
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I'm not a fan of adding more configuration option (in general).
Looking at what is logged, we might as well just set this to "warning".
WDYT?
../Frenck
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
It would be nice to reduce unnecessary logspam, e.g. that every single HTTP request gets logged in the default 'info' loglevel of
hass-configurator
, with no easy way to fix this. And it does indeed have a loglevel flag ( https://github.com/danielperna84/hass-configurator/blob/397bda2f9131d2c1c979bf01391745699852b049/hass_configurator/configurator.py#L105 ) that is however not exposed in the Home Assistant addon configuration.Summary by CodeRabbit
New Features
loglevel
for the "File editor" add-on.Documentation
loglevel
feature.loglevel
option.Configuration Updates
loglevel
option with a default value of 'info'.