#NEWLINE# def set_stream_logger( name , level = logging . DEBUG , format_string = None ) : #NEWLINE# #INDENT# global log #NEWLINE# if ( not format_string ) : #NEWLINE# #INDENT# format_string = '%(asctime)s %(name)s [%(levelname)s]:%(message)s' #NEWLINE# #UNINDENT# logger = logging . getLogger ( name ) #NEWLINE# logger . setLevel ( level ) #NEWLINE# fh = logging . StreamHandler ( ) #NEWLINE# fh . setLevel ( level ) #NEWLINE# formatter = logging . Formatter ( format_string ) #NEWLINE# fh . setFormatter ( formatter ) #NEWLINE# logger . addHandler ( fh ) #NEWLINE# log = logger