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

Improve logging #249

Open
marimeireles opened this issue Mar 18, 2021 · 0 comments
Open

Improve logging #249

marimeireles opened this issue Mar 18, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@marimeireles
Copy link
Collaborator

Problem

Our logging system is not as good as it could be.

Proposed Solution

I propose doing something like this:

# assuming loglevel is bound to the string value obtained from the
# command line argument. Convert to upper case to allow the user to
# specify --log=DEBUG or --log=debug
numeric_level = getattr(logging, loglevel.upper(), None)
if not isinstance(numeric_level, int):
   raise ValueError('Invalid log level: %s' % loglevel)
logging.basicConfig(level=numeric_level, ...)

Which allows us to pass the desired logging level as cmd line option.

See more context on how to implement it here: https://docs.python.org/3/howto/logging.html

@marimeireles marimeireles added the enhancement New feature or request label Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant