#NEWLINE# def emit( self , record ) : #NEWLINE# #INDENT# if isinstance ( record . args , dict ) : #NEWLINE# #INDENT# fmt = record . args . get ( 'log_format' , record . args . get ( 'log_message' , '' ) ) #NEWLINE# message = fmt . format ( ** record . args ) #NEWLINE# dt = datetime . fromtimestamp ( record . args . get ( 'log_time' , 0 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# message = record . getMessage ( ) #NEWLINE# dt = datetime . fromtimestamp ( record . created ) #NEWLINE# #UNINDENT# msg = '{0} {1}{2}' . format ( dt . strftime ( '%Y-%m-%dT%H:%M:%S%z' ) , message , os . linesep ) #NEWLINE# if self . _encode : #NEWLINE# #INDENT# msg = msg . encode ( 'utf8' ) #NEWLINE# #UNINDENT# self . _file . write ( msg )