view lib/standardservice/logsetup.py @ 529:af9a29a63a28

typo from addition of verboseLogging Ignore-this: 76d72724b9a8bb7375f41a616ff84f0d
author drewp@bigasterisk.com
date Tue, 23 Apr 2019 02:17:35 -0700
parents 77181261f8ce
children 0c7fa3bbbba7
line wrap: on
line source

# 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():
    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)