pyca/config.py
def logger_init():
    '''Initialize logger based on configuration
    '''
    handlers = []
    logconf = config('logging')
    if logconf['syslog']:
        handlers.append(logging.handlers.SysLogHandler(address='/dev/log'))
    if logconf['stderr']:
        handlers.append(logging.StreamHandler(sys.stderr))
    if logconf['file']:
        handlers.append(logging.handlers.WatchedFileHandler(logconf['file']))
    for handler in handlers:
        handler.setFormatter(logging.Formatter(logconf['format']))
        logging.root.addHandler(handler)

    logging.root.setLevel(logconf['level'].upper())
    logger.info('Log level set to %s' % logconf['level'])
def logger_init():
    '''Initialize logger based on configuration
    '''
    handlers = []
    logconf = config('logging')
    if logconf['syslog']:
        handlers.append(logging.handlers.SysLogHandler(address='/dev/log'))
    if logconf['stderr']:
        handlers.append(logging.StreamHandler(sys.stderr))
    if logconf['file']:
        handlers.append(logging.handlers.WatchedFileHandler(logconf['file']))
    for handler in handlers:
        handler.setFormatter(logging.Formatter(logconf['format']))
        logging.root.addHandler(handler)

    logging.root.setLevel(logconf['level'].upper())
    logger.info('Log level set to %s' % logconf['level'])
def logger_init ( ) : handlers = [ ] logconf = config ( 'logging' ) if logconf [ 'syslog' ] : handlers . append ( logging . handlers . SysLogHandler ( address = '/dev/log' ) ) if logconf [ 'stderr' ] : handlers . append ( logging . StreamHandler ( sys . stderr ) ) if logconf [ 'file' ] : handlers . append ( logging . handlers . WatchedFileHandler ( logconf [ 'file' ] ) ) for handler in handlers : handler . setFormatter ( logging . Formatter ( logconf [ 'format' ] ) ) logging . root . addHandler ( handler ) logging . root . setLevel ( logconf [ 'level' ] . upper ( ) ) logger . info ( 'Log level set to %s' % logconf [ 'level' ] )
Initialize logger based on configuration
Initialize logger based on configuration