#NEWLINE# def __init__( self , config = None , log_level = None , log_file = None , daemonize = False ) : #NEWLINE# #INDENT# self . config_file = ( config if config else '/etc/salt/eventsd' ) #NEWLINE# self . opts = self . _read_yaml ( self . config_file ) #NEWLINE# if ( 'general' in self . opts ) : #NEWLINE# #INDENT# self . gen_opts = copy . deepcopy ( self . opts [ 'general' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( "No 'general' options found in config file: {0}" . format ( self . config_file ) ) #NEWLINE# #UNINDENT# if log_level : #NEWLINE# #INDENT# self . gen_opts [ 'loglevel' ] = log_level #NEWLINE# #UNINDENT# if config : #NEWLINE# #INDENT# self . gen_opts [ 'logfile' ] = log_file #NEWLINE# #UNINDENT# self . gen_opts [ 'daemonize' ] = daemonize #NEWLINE# self . _init_logger ( ) #NEWLINE# log . info ( 'loaded config from {0}' . format ( config ) )