Mercurial > code > home > repos > homeauto
diff lib/standardservice/logsetup.py @ 523:77181261f8ce
move logsetup into new standardservice pkg
Ignore-this: 7dbc4224ad2e8beb2534ccb4943e9a27
author | drewp@bigasterisk.com |
---|---|
date | Tue, 23 Apr 2019 01:29:32 -0700 |
parents | lib/logsetup.py@163cfa384372 |
children | af9a29a63a28 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/standardservice/logsetup.py Tue Apr 23 01:29:32 2019 -0700 @@ -0,0 +1,21 @@ +# todo: graylog, twisted web route to some channel + +import logging +logging.basicConfig(format="%(created)f %(asctime)s %(name)s %(levelname)s %(message)s") +logging.getLogger('restkit.client').setLevel(logging.WARN) +log = logging.getLogger() +log.setLevel(logging.INFO) + +def enableTwistedLog(yes): + from twisted.python import log as twlog + import sys + twlog.startLogging(sys.stdout) + +def verboseLogging(yes): + if yes: + enableTwistedLog() + log.setLevel(logging.DEBUG) + else: + log.setLevel(logging.WARN) + +