Skip to content

Commit

Permalink
Merge pull request #3 from birnevogel11/04-remove-setlevel
Browse files Browse the repository at this point in the history
Add an environment variable to remove all handlers of nose logger
  • Loading branch information
aigarius authored Jan 5, 2024
2 parents a543c57 + d3e419d commit 65c6487
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nose/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def __init__(self, **kw):
self.debug = env.get('NOSE_DEBUG')
self.debugLog = env.get('NOSE_DEBUG_LOG')
self.logPropagate = bool(env.get('NOSE_LOG_PROPAGATE', False))
self.logNoLogHandlers = bool(env.get('NOSE_NO_LOG_HANDLERS', False))
self.exclude = None
self.getTestCaseNamesCompat = False
self.includeExe = env.get('NOSE_INCLUDE_EXE',
Expand Down Expand Up @@ -389,6 +390,9 @@ def configureLogging(self):
if not found:
logger.addHandler(handler)

if self.logNoLogHandlers:
logger.handlers = []

# default level
lvl = logging.WARNING
if self.verbosity >= 5:
Expand Down

0 comments on commit 65c6487

Please sign in to comment.