#NEWLINE# def format( self , record ) : #NEWLINE# #INDENT# date = colored ( '[%(asctime)s %(lineno)d@%(filename)s:%(name)s]' , 'green' ) #NEWLINE# msg = '%(message)s' #NEWLINE# if ( record . levelno == logging . WARNING ) : #NEWLINE# #INDENT# fmt = ( ( ( ( date + ' ' ) + colored ( 'WRN' , 'red' , attrs = [ 'blink' ] ) ) + ' ' ) + msg ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( record . levelno == logging . ERROR ) or ( record . levelno == logging . CRITICAL ) ) : #NEWLINE# #INDENT# fmt = ( ( ( ( date + ' ' ) + colored ( 'ERR' , 'red' , attrs = [ 'blink' , 'underline' ] ) ) + ' ' ) + msg ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fmt = ( ( date + ' ' ) + msg ) #NEWLINE# #UNINDENT# #UNINDENT# if hasattr ( self , '_style' ) : #NEWLINE# #INDENT# self . _style . _fmt = fmt #NEWLINE# self . _fmt = msg #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _fmt = fmt #NEWLINE# #UNINDENT# return super ( MyFormatter , self ) . format ( record )