CoolFace
Apppublic

Mahbodez/knee_report_checklist

sourceHugging Faceopenrailupdated 3y agoView on Hugging Face
1likes
logger.py14 linesDownload Raw Back to root
1class Logger:2    def __init__(self, log_file):3        self.log_file = log_file4 5    def log(self, name, message):6        try:7            with open(self.log_file, "a", encoding="utf-8") as f:8                f.write(f"[{name}]: {message}\n")9        except OSError as ex:10            print(f"Error logging message: {ex}")11 12    def __call__(self, name, message):13        self.log(name, message)14