#NEWLINE# def configure_logging( path ) : #NEWLINE# #INDENT# if path : #NEWLINE# #INDENT# if os . path . isdir ( path ) : #NEWLINE# #INDENT# path = os . path . join ( path , 'shapes.log' ) #NEWLINE# #UNINDENT# handler = logging . FileHandler ( path ) #NEWLINE# handler . setLevel ( logging . DEBUG ) #NEWLINE# formatter = logging . Formatter ( '%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) #NEWLINE# handler . setFormatter ( formatter ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# handler = logging . NullHandler ( ) #NEWLINE# #UNINDENT# shapeLogger . addHandler ( handler ) #NEWLINE# shapeLogger . setLevel ( logging . DEBUG )