Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

Commit

Permalink
update settings and tests to not double log either
Browse files Browse the repository at this point in the history
  • Loading branch information
czue committed Mar 5, 2014
1 parent 63c41d1 commit 19ad8e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions couchlog/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def setUp(self):
# imperative config
self.logger = logging.getLogger('couchlog.tests')
self.original_log_level = logging.root.getEffectiveLevel()
for handler in list(self.logger.handlers):
if isinstance(handler, CouchHandler):
self.logger.removeHandler(handler)
logging.root.setLevel(logging.ERROR)
init_handler()

Expand Down
15 changes: 8 additions & 7 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

SECRET_KEY = 'this is not a secret key'

print 'couchlog settings'
INSTALLED_APPS = (
'couchlog',
'couchdbkit.ext.django',
Expand Down Expand Up @@ -44,16 +45,16 @@
LOGGING = {
'version': 1,
'handlers': {
'couchlog': {
'level': 'WARNING',
'class': 'couchlog.handlers.CouchHandler',
'null': {
'level': 'DEBUG',
'class': 'django.utils.log.NullHandler',
},
},
'loggers': {
'couchlog.tests': {
'level': 'INFO',
'propagate': True,
'handlers': ['couchlog'],
'': {
'level': 'CRITICAL',
'handler': 'null',
'propagate': False,
}
}
}

0 comments on commit 19ad8e0

Please sign in to comment.