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

Discuss how to share LOG attribute in the CLI #714

Open
evrose54 opened this issue Jul 26, 2024 · 0 comments · May be fixed by #759
Open

Discuss how to share LOG attribute in the CLI #714

evrose54 opened this issue Jul 26, 2024 · 0 comments · May be fixed by #759
Labels
cli Command line interface tasks refactor Code refactoring updates

Comments

@evrose54
Copy link
Contributor

evrose54 commented Jul 26, 2024

Requested Update

Description

PR #659 introduced a new shared argument --log-level which sets the level in which we'll output information with a logger object. This argument is now working, however it's not easy to access the LOG attribute that will be shared amongst all command classes. Currently, the way to access LOG goes as such:

self.LOG = getattr(LOG, self.GEOIPS_ARGS.log_level)
self.LOG("LOG LEVEL = {self.GEOIPS_ARGS.log_level}")

This sets the logger object at the correct log level, but this does not actually share the same logger object with all command classes. We need to figure out a method to parse --log-level before all command classes are initialized, so they can all inherit the same logger object from GeoipsCommand.

Background and Motivation

This comes from this comment on PR #659.

Code to demonstrate issue

geoips.commandline.commandline_interface:GeoipsCLI:execute_command

@evrose54 evrose54 added refactor Code refactoring updates cli Command line interface tasks labels Jul 26, 2024
@evrose54 evrose54 linked a pull request Aug 26, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command line interface tasks refactor Code refactoring updates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant