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

User loggers instead of verbose and veryVerbose #7

Open
thammegowda opened this issue Aug 3, 2017 · 0 comments
Open

User loggers instead of verbose and veryVerbose #7

thammegowda opened this issue Aug 3, 2017 · 0 comments

Comments

@thammegowda
Copy link

Background:
👍 for #5 (make it as PyPi package)
That will make smatch as an easily accessible library.
It will be nice to replace prints with log statements (so that library users can easily control)

Mappings:

Error -> logger.error
Verbose -> logger.info
VeryVerbose -> logger.debug

Then, we can set log level from CLI args for backward compatibiltiy.
default level = WARNING
When Verbose flag is enabled, level=INFO
When VeryVerbose flag is enabled, level=DEBUG

References:

https://docs.python.org/3/library/logging.html

goodmami added a commit to goodmami/smatch that referenced this issue Dec 23, 2019
This is a fairly direct conversion of the code to use logging. It
could be made more Pythonic.

This also gets rid of the ERROR_LOG and DEBUG_LOG variables for
redirecting error and debug messages. They could only be used when
importing smatch as a library and both pointed to stderr by
default. The logging messages are prefixed by DEBUG, ERROR, etc., so
if anything they are now easier to distinguish. Getting support for
separate streams would now require some logging Handlers and Filters,
which are a pain to set up.

Resolves snowblink14#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant