diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-03-14 21:37:32 -0500 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-03-14 21:37:32 -0500 |
| commit | e2314c38ed464812e04be5fba3f7e2091cbc5500 (patch) | |
| tree | 4ecdc7d41df4f4c7953351a3c0c502abfb491ee7 | |
| parent | 447a6d4fccf92e20f003473f1a32cf118d1c320d (diff) | |
| download | flake8-e2314c38ed464812e04be5fba3f7e2091cbc5500.tar.gz | |
Add a lower level for extra verbosity
| -rw-r--r-- | flake8/__init__.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/flake8/__init__.py b/flake8/__init__.py index 53e56f8..40336ad 100644 --- a/flake8/__init__.py +++ b/flake8/__init__.py @@ -30,14 +30,21 @@ del NullHandler __version__ = '3.0.0a1' +# There is nothing lower than logging.DEBUG (10) in the logging library, +# but we want an extra level to avoid being too verbose when using -vv. +_EXTRA_VERBOSE = 5 +logging.addLevelName(_EXTRA_VERBOSE, 'VERBOSE') + _VERBOSITY_TO_LOG_LEVEL = { # output more than warnings but not debugging info - 1: logging.INFO, - # output debugging information and everything else - 2: logging.DEBUG, + 1: logging.INFO, # INFO is a numerical level of 20 + # output debugging information + 2: logging.DEBUG, # DEBUG is a numerical level of 10 + # output extra verbose debugging information + 3: _EXTRA_VERBOSE, } -LOG_FORMAT = ('[%(name)-25s]:%(threadName)s %(relativeCreated)6d ' +LOG_FORMAT = ('%(name)-25s %(processName)-11s %(relativeCreated)6d ' '%(levelname)-8s %(message)s') @@ -54,8 +61,8 @@ def configure_logging(verbosity, filename=None, logformat=LOG_FORMAT): """ if verbosity <= 0: return - if verbosity > 2: - verbosity = 2 + if verbosity > 3: + verbosity = 3 log_level = _VERBOSITY_TO_LOG_LEVEL[verbosity] |
