#NEWLINE# def setup( self , cfg ) : #NEWLINE# #INDENT# self . loglevel = self . LOG_LEVELS . get ( cfg . loglevel . lower ( ) , logging . INFO ) #NEWLINE# self . error_log . setLevel ( self . loglevel ) #NEWLINE# self . access_log . setLevel ( logging . INFO ) #NEWLINE# self . _set_handler ( self . error_log , cfg . errorlog , logging . Formatter ( self . error_fmt , self . datefmt ) ) #NEWLINE# if ( cfg . accesslog is not None ) : #NEWLINE# #INDENT# self . _set_handler ( self . access_log , cfg . accesslog , fmt = logging . Formatter ( self . access_fmt ) ) #NEWLINE# #UNINDENT# if cfg . syslog : #NEWLINE# #INDENT# self . _set_syslog_handler ( self . error_log , cfg , self . syslog_fmt , 'error' ) #NEWLINE# self . _set_syslog_handler ( self . access_log , cfg , self . syslog_fmt , 'access' ) #NEWLINE# #UNINDENT# if cfg . logconfig : #NEWLINE# #INDENT# if os . path . exists ( cfg . logconfig ) : #NEWLINE# #INDENT# defaults = CONFIG_DEFAULTS . copy ( ) #NEWLINE# defaults [ '__file__' ] = cfg . logconfig #NEWLINE# defaults [ 'here' ] = os . path . dirname ( cfg . logconfig ) #NEWLINE# fileConfig ( cfg . logconfig , defaults = defaults , disable_existing_loggers = False ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# msg = "Error: log config '%s' not found" #NEWLINE# raise RuntimeError ( ( msg % cfg . logconfig ) )