#NEWLINE# def setup_logger( logger = None , level = 'INFO' ) : #NEWLINE# #INDENT# 'Setup logging for CLI use.\n\n    :param logger: instance of logger\n    :type logger: :py:class:`Logger`\n\n    ' #NEWLINE# if ( not logger ) : #NEWLINE# #INDENT# logger = logging . getLogger ( ) #NEWLINE# #UNINDENT# if ( not logger . handlers ) : #NEWLINE# #INDENT# channel = logging . StreamHandler ( ) #NEWLINE# channel . setFormatter ( log . DebugLogFormatter ( ) ) #NEWLINE# logger . setLevel ( level ) #NEWLINE# logger . addHandler ( channel )