Mercurial > libervia-backend
comparison src/sat.tac @ 994:652c01ca69b1
core (log): configuration and environment variables are now checked for log level and colors:
- variable change logs behaviour, so far only level and colors are implemented
- configuration use log_[name], for example you can put log_level=debug in sat.conf (section [DEFAULT]) to see all levels
- environment variables use SAT_LOG_[NAME]: e.g. SAT_LOG_LEVEL=debug
- colors can be true, false or force to force colors even if stdout is not a tty
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 19 Apr 2014 20:11:23 +0200 |
parents | 05e02f8b7eb4 |
children | 73a0b7f94674 |
comparison
equal
deleted
inserted
replaced
993:301b342c697a | 994:652c01ca69b1 |
---|---|
19 | 19 |
20 from twisted.application import service | 20 from twisted.application import service |
21 from twisted.internet import glib2reactor | 21 from twisted.internet import glib2reactor |
22 glib2reactor.install() | 22 glib2reactor.install() |
23 | 23 |
24 from sat.core.constants import Const as C | 24 # XXX: We need to configure logs before any log method is used, so here is the best place. |
25 from sat.core import log | 25 from sat.core import log |
26 log.configure(C.LOG_BACKEND_TWISTED) | 26 log.satConfigure() |
27 | 27 |
28 # XXX: SAT must be imported after log configuration, because it write stuff to logs | |
28 from sat.core.sat_main import SAT | 29 from sat.core.sat_main import SAT |
30 | |
29 | 31 |
30 application = service.Application('SàT') | 32 application = service.Application('SàT') |
31 service = SAT() | 33 service = SAT() |
32 service.setServiceParent(application) | 34 service.setServiceParent(application) |