#NEWLINE# def configure_logging( app ) : #NEWLINE# #INDENT# 'Configure file(info) and email(error) logging.' #NEWLINE# if ( info_log . debug or app . testing ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# import logging.handlers #NEWLINE# app . logger . setLevel ( logging . INFO ) #NEWLINE# info_log = os . path . join ( app . config [ 'LOG_FOLDER' ] , 'info.log' ) #NEWLINE# info_file_handler = logging . handlers . RotatingFileHandler ( info_log , maxBytes = 100000 , backupCount = 10 ) #NEWLINE# info_file_handler . setLevel ( logging . INFO ) #NEWLINE# info_file_handler . setFormatter ( logging . Formatter ( '%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]' ) ) #NEWLINE# app . logger . addHandler ( info_file_handler )