<s> import logging <EOL> import sys <EOL> def setup_logging ( ) : <EOL> logger = logging . getLogger ( ) <EOL> logger . setLevel ( logging . DEBUG ) <EOL> try : <EOL> import colorlog <EOL> formatter = colorlog . ColoredFormatter ( <EOL> "<STR_LIT>" , <EOL> datefmt = None , <EOL> reset = True , <EOL> log_colors = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> ) <EOL> stream_handler = logging . StreamHandler ( stream = sys . stdout ) <EOL> stream_handler . setLevel ( logging . DEBUG ) <EOL> stream_handler . setFormatter ( formatter ) <EOL> logger . addHandler ( stream_handler ) <EOL> except ImportError : <EOL> pass </s>
