-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add logging filename, level and format #12
Conversation
ca4f4cc
to
1a8a467
Compare
786caa8
to
afcc177
Compare
b8fa005
to
d00e716
Compare
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.
No matter where the adapter is deployed we want logging. If there are config options for the logger I think those would be handled in core code where the logger is instantiated.
If there's an additional handler needed by a plugin beyond stream handler I think that's best setup in the plugin setup hook. For VM based adapters it means there's a stream handler and a file based handler. Which seems fine.
Set the logging on setup_adapter and tests
614a4ee
to
0d8fd73
Compare
058a9c4
to
fafef20
Compare
csp_billing_adapter_local/plugin.py
Outdated
@csp_billing_adapter.hookimpl | ||
def setup_adapter(config: Config): | ||
log_to_file = logging.FileHandler(CSP_LOG_FILEPATH) | ||
csp_log = logging.getLogger(LOGGER_NAME) |
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.
should either be csp_log = log
or log = logging.getLogger(LOGGER_NAME)
on line 37 should be removed. Why create the module variable at the top level when it is not being used?
Remove get logger call in favor of using log previously declared
Should be merged after #10