def get_logger(name):
 old_class = logging.getLoggerClass()
 logging.setLoggerClass(logging.Logger)
 logger = logging.getLogger(name)
 logging.setLoggerClass(old_class)
 return logger

def get_logger ( name ) : old_class = logging . getLoggerClass ( ) logging . setLoggerClass ( logging . Logger ) logger = logging . getLogger ( name ) logging . setLoggerClass ( old_class ) return logger
attach a file handler to the logger if there isnt one already .