<s> import logging <EOL> class LoggerFactory ( object ) : <EOL> _isSetup = False <EOL> def __init__ ( self , level = logging . DEBUG ) : <EOL> if LoggerFactory . _isSetup is False : <EOL> logger = logging . getLogger ( "<STR_LIT>" ) <EOL> logger . setLevel ( level ) <EOL> formatter = logging . Formatter ( '<STR_LIT>' ) <EOL> ch = logging . StreamHandler ( ) <EOL> ch . setLevel ( level ) <EOL> ch . setFormatter ( formatter ) <EOL> logger . addHandler ( ch ) <EOL> LoggerFactory . _isSetup = True <EOL> def getLogger ( self , name , level = logging . DEBUG ) : <EOL> logger = logging . getLogger ( "<STR_LIT>" % name ) <EOL> logger . setLevel ( level ) <EOL> return logger </s>
