<s> import cloghandler <EOL> import logging <EOL> import logging . handlers <EOL> from settings import DEBUG <EOL> if DEBUG : <EOL> LOG_LEVEL = logging . DEBUG <EOL> else : <EOL> LOG_LEVEL = logging . INFO <EOL> LOG_PATH = '<STR_LIT>' <EOL> formatter = logging . Formatter ( <EOL> '<STR_LIT>' ) <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> try : <EOL> filehandler = cloghandler . ConcurrentRotatingFileHandler ( '<STR_LIT>' . join ( <EOL> [ LOG_PATH , '<STR_LIT>' ] ) , <EOL> mode = '<STR_LIT:a>' , maxBytes = <NUM_LIT:10> * <NUM_LIT:2> ** <NUM_LIT:20> , backupCount = <NUM_LIT:3> ) <EOL> filehandler . setLevel ( LOG_LEVEL ) <EOL> filehandler . setFormatter ( formatter ) <EOL> logger . addHandler ( filehandler ) <EOL> handler = logging . StreamHandler ( ) <EOL> handler . setLevel ( LOG_LEVEL ) <EOL> handler . setFormatter ( formatter ) <EOL> logger . addHandler ( handler ) <EOL> logger . setLevel ( LOG_LEVEL ) <EOL> except IOError as e : <EOL> print e </s>
