Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(57)

Issue 51280047: Remove existing Log handers when setupLogging.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by rharding
Modified:
10 years, 3 months ago
Reviewers:
frankban, mp+201453
Visibility:
Public.

Description

Remove existing Log handers when setupLogging. - If there are existing handlers on the root logger then the logging.basicConfig is a noop. Changes we expect to see will not occur. https://code.launchpad.net/~rharding/charms/precise/juju-gui/fix-log-test/+merge/201453 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -0 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M hooks/utils.py View 1 chunk +9 lines, -0 lines 2 comments Download

Messages

Total messages: 2
rharding
Please take a look.
10 years, 3 months ago (2014-01-13 16:43:12 UTC) #1
frankban
10 years, 3 months ago (2014-01-13 16:49:21 UTC) #2
LGTM with the suggested changes (especially the second one).
Thank you!

https://codereview.appspot.com/51280047/diff/1/hooks/utils.py
File hooks/utils.py (right):

https://codereview.appspot.com/51280047/diff/1/hooks/utils.py#newcode327
hooks/utils.py:327: if root_logger.handlers:
This check can be omitted.

https://codereview.appspot.com/51280047/diff/1/hooks/utils.py#newcode328
hooks/utils.py:328: for handler in root_logger.handlers:
I'd suggest to use:
for handler in root_logger.handlers[:]:
so that we avoid modifying in place the list we are looping over.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b