<s> """<STR_LIT>""" <EOL> import logging <EOL> def get_logger ( log_level = logging . DEBUG , file_path_name = None ) : <EOL> logger = logging . getLogger ( __name__ ) <EOL> logger . setLevel ( logging . ERROR ) <EOL> if file_path_name : <EOL> ch = logging . FileHandler ( file_path_name ) <EOL> elif log_level is None : <EOL> logger . handlers = [ logging . NullHandler ( ) ] <EOL> return logger <EOL> else : <EOL> ch = logging . StreamHandler ( ) <EOL> ch . setLevel ( log_level ) <EOL> formatter = logging . Formatter ( <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> ch . setFormatter ( formatter ) <EOL> logger . handlers = [ ch ] <EOL> return logger </s>
