view lib/standardservice/logsetup.py @ 1362:8642ed427607

release 0.3.0 Ignore-this: f13d1f16ca4f51685855dbdcdc69c10c darcs-hash:ab18896fb0dbfd110412a523b083a974103da7f2
author drewp <drewp@bigasterisk.com>
date Wed, 01 May 2019 00:07:13 -0700
parents 9d4684867908
children d3b8d9ffebca
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)