(self, path="log.txt")
| 41 | |
| 42 | class Logger(): |
| 43 | def __init__(self, path="log.txt"): |
| 44 | self.logger = logging.getLogger('BiRefNet') |
| 45 | self.file_handler = logging.FileHandler(path, "w") |
| 46 | self.stdout_handler = logging.StreamHandler() |
| 47 | self.stdout_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) |
| 48 | self.file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) |
| 49 | self.logger.addHandler(self.file_handler) |
| 50 | self.logger.addHandler(self.stdout_handler) |
| 51 | self.logger.setLevel(logging.INFO) |
| 52 | self.logger.propagate = False |
| 53 | |
| 54 | def info(self, txt): |
| 55 | self.logger.info(txt) |
nothing calls this directly
no outgoing calls
no test coverage detected