-
Notifications
You must be signed in to change notification settings - Fork 881
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
Cleanup Logging Configuration #4435
Cleanup Logging Configuration #4435
Commits on Sep 20, 2023
-
Remove unnecessary logging wrapper in Cloud class (canonical#4435)
Cloud.cycle_logging() is only called once in the codebase, and its only benefit is turning two function calls into a single call. Remove it.
Configuration menu - View commit details
-
Copy full SHA for 3434db7 - Browse repository at this point
Copy the full SHA 3434db7View commit details -
cloudinit.log: Standardize use of cloudinit's logging module (canonic…
…al#4435) cloud-init's log module implements a wrapper for logging.getLogger, however this module is not consistently used across the codebase. Furthermore most of these invocations choose to alias cloudinit.log module to logging. Shadowing a standard library module, and especially doing so inconsistently across the codebase, is not best practice. Since this wrapper doesn't add value, replace all invocations with the standard library call. Also standardize logger names to use logging.getLogger(__name__).
Configuration menu - View commit details
-
Copy full SHA for b561666 - Browse repository at this point
Copy the full SHA b561666View commit details -
cloudinit.log: Remove unused getLogger wrapper (canonical#4435)
This wrapper provided a default logger with name "cloudinit" when called without arguments. This behavior was never used and can safely be removed.
Configuration menu - View commit details
-
Copy full SHA for 0ce9acf - Browse repository at this point
Copy the full SHA 0ce9acfView commit details -
Configuration menu - View commit details
-
Copy full SHA for f9d7b61 - Browse repository at this point
Copy the full SHA f9d7b61View commit details -
Simplify root logger configuration (canonical#4435)
The root logger gets configured at various stages of cloudinit execution. Some changes occur while importing cloudinit.log, which causes side effects in any project using cloudinit as a library (Ubuntu Pro, etc). These modifications do not require change during runtime and can take place as an early setup task in cloudinit.cmd.main::main(). Simplify this code, relocate logger configuration code to a function in cloudinit.log, set the callsite in cloudinit.cmd.main::main(). Also add context to logging configuration code.
Configuration menu - View commit details
-
Copy full SHA for cf812f6 - Browse repository at this point
Copy the full SHA cf812f6View commit details -
cloudinit.log: Don't configure NullHandler (canonical#4435)
NullHandler hasn't been required to prevent the logging warnings since commit 5a27d4018 landed in Python, which was released in Python 3.2.
Configuration menu - View commit details
-
Copy full SHA for 0d99945 - Browse repository at this point
Copy the full SHA 0d99945View commit details -
cloudinit.log: Use more appropriate exception (canonical#4435)
cloud-init's logging code has for a long time caught and ignored a bare Exception. Use a more specific exception for the expected case that this handles.
Configuration menu - View commit details
-
Copy full SHA for b13037c - Browse repository at this point
Copy the full SHA b13037cView commit details