<s> import logging <EOL> import sys <EOL> LOG_LEVEL = None <EOL> try : <EOL> from instance import settings <EOL> LOG_LEVEL = settings . LOG_LEVEL <EOL> except ( ImportError , AttributeError ) : <EOL> from config import settings <EOL> LOG_LEVEL = settings . LOG_LEVEL <EOL> LOGGING_LEVEL = <NUM_LIT:0> <EOL> if LOG_LEVEL == '<STR_LIT>' : <EOL> LOGGING_LEVEL = <NUM_LIT:10> <EOL> elif LOG_LEVEL == '<STR_LIT>' : <EOL> LOGGING_LEVEL = <NUM_LIT:20> <EOL> elif LOG_LEVEL == '<STR_LIT>' : <EOL> LOGGING_LEVEL = <NUM_LIT:30> <EOL> elif LOG_LEVEL == '<STR_LIT>' : <EOL> LOGGING_LEVEL = <NUM_LIT> <EOL> elif LOG_LEVEL == '<STR_LIT>' : <EOL> LOGGING_LEVEL = <NUM_LIT:50> <EOL> root = logging . getLogger ( ) <EOL> root . setLevel ( LOGGING_LEVEL ) <EOL> stream_handler = logging . StreamHandler ( sys . stdout ) <EOL> stream_handler . setLevel ( LOGGING_LEVEL ) <EOL> root . addHandler ( stream_handler ) </s>
