# -*- coding: utf-8 -*-
# $Id: settings.py 1634 2013-04-12 15:36:36Z amelung $
#
# Copyright (c) 2007-2013 Otto-von-Guericke-Universität Magdeburg
#
# This file is part of ECSpooler.
#
import logging
# uid and gid for nobody
try:
import pwd
except ImportError:
# init logging
"""
Initialize logging using root logger and specified name for log file.
@param name: specified logger name which will be used as basename for log file.
"""
# use root logger
get_logger(None, name)
def get_logger(name, filename=None, level=LOG_LEVEL, maxBytes=LOG_FILESIZE, backupCount=LOG_FILES, fmt=LF_LONG):
"""
Return logger with the given parameters
@param name: specified logger name which will be used as basename of the logfile.
@param level: log level to set. Default: LOG_LEVEL
@param maxBytes: max. size of the rotating logfile. Default: LOG_FILESIZE
@param backupCount: max. number of rotating logfiles. Default: LOG_FILES
@param fmt: log format to use. Default: LOG_FORMAT
@return: the log handler used
"""
# set log level
# set log file
if filename:
else:
# set log format
# add handler
return log