#NEWLINE# def get_logger( self , logger_name , filename ) : #NEWLINE# #INDENT# log = logging . getLogger ( logger_name ) #NEWLINE# log . setLevel ( self . verbosity_map . get ( self . verbosity , logging . INFO ) ) #NEWLINE# if self . logfile : #NEWLINE# #INDENT# handler = RotatingFileHandler ( filename , maxBytes = ( 1024 * 1024 ) , backupCount = 2 ) #NEWLINE# handler . setFormatter ( logging . Formatter ( '%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) ) #NEWLINE# log . addHandler ( handler ) #NEWLINE# #UNINDENT# if ( ( self . verbosity == 2 ) or ( not self . logfile ) ) : #NEWLINE# #INDENT# stream_handler = logging . StreamHandler ( ) #NEWLINE# stream_handler . setFormatter ( logging . Formatter ( '%(asctime)s - %(levelname)s - %(message)s' ) ) #NEWLINE# log . addHandler ( stream_handler ) #NEWLINE# #UNINDENT# return log