Skip to content

Instantly share code, notes, and snippets.

@timitos
Created September 20, 2016 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timitos/f74e5c6b5c75064f9c9d2417f23e6cad to your computer and use it in GitHub Desktop.
Save timitos/f74e5c6b5c75064f9c9d2417f23e6cad to your computer and use it in GitHub Desktop.
import os
import logging
import logging.config
from trytond.config import config
from trytond.application import app
logconf = os.environ.get('TRYTOND_LOGCONF')
if logconf:
logging.config.fileConfig(logconf)
logging.getLogger('server').info('using %s as logging '
'configuration file', logconf)
else:
logformat = ('%(process)s %(thread)s [%(asctime)s] '
'%(levelname)s %(name)s %(message)s')
level = logging.ERROR
logging.basicConfig(level=level, format=logformat)
logging.captureWarnings(True)
config.update_etc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment