1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-26 16:45:52 +00:00
Radicale/radicale/log.py
Corentin Le Bail 284063a270 Merge branch 'master' of git://gitorious.org/~clebail/radicale/ares-radicale
Conflicts:
	config
	radicale/acl/authLdap.py
	radicale/config.py
	radicale/log.py
2011-02-16 14:17:28 +01:00

23 lines
540 B
Python

# -*- coding: utf-8 -*-
import logging, sys
from radicale import config
class log:
def __init__(self):
self.logger=logging.getLogger("radicale")
self.logger.setLevel(config.get("logging", "facility"))
handler=logging.FileHandler(config.get("logging", "logfile"))
formatter = logging.Formatter('%(name)s %(asctime)s %(levelname)s %(message)s')
handler.setFormatter(formatter)
self.logger.addHandler(handler)
def log(self, level, msg):
self.logger.log(level, msg)
_LOGGING = log()
sys.modules[__name__] = _LOGGING