Skip to content

logging: do not change the root logger's level #683

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion debug_toolbar/panels/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def emit(self, record):

collector = LogCollector()
logging_handler = ThreadTrackingHandler(collector)
logging.root.setLevel(logging.NOTSET)
logging.root.addHandler(logging_handler)


Expand Down
4 changes: 4 additions & 0 deletions tests/panels/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def setUp(self):
self.logger = logging.getLogger(__name__)
collector.clear_collection()

# Assume the root logger has been configured with level=DEBUG.
# Previously DDT forcefully set this itself to 0 (NOTSET).
logging.root.setLevel(logging.DEBUG)

def test_happy_case(self):
self.logger.info('Nothing to see here, move along!')

Expand Down