(self, config)
| 50 | return cls._instance |
| 51 | |
| 52 | def __init__(self, config): |
| 53 | if config.log.log_level == "debug": |
| 54 | logging_level = logging.DEBUG |
| 55 | elif config.log.log_level == "info": |
| 56 | logging_level = logging.INFO |
| 57 | elif config.log.log_level == "warn": |
| 58 | logging_level = logging.WARN |
| 59 | elif config.log.log_level == "error": |
| 60 | logging_level = logging.ERROR |
| 61 | else: |
| 62 | raise TypeError( |
| 63 | "No logging type named %s, candidate is: info, debug, error") |
| 64 | logging.basicConfig(filename=config.log.logger_file, |
| 65 | level=logging_level, |
| 66 | format='%(asctime)s : %(levelname)s %(message)s', |
| 67 | filemode="a", datefmt='%Y-%m-%d %H:%M:%S') |
| 68 | |
| 69 | @staticmethod |
| 70 | def debug(msg): |
nothing calls this directly
no outgoing calls
no test coverage detected