MCPcopy Index your code
hub / github.com/MCSLTeam/MCSL2 / __init__

Method __init__

MCSL2Lib/ProgramControllers/logController.py:39–57  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37
38class _MCSL2Logger:
39 def __init__(self):
40 self.time = datetime.now().strftime("%Y-%m-%d_%H")
41 self.logger = loguru_logger
42 self.logger.add(
43 self._getLogFile(),
44 rotation="1 day",
45 retention="14 days",
46 level="DEBUG",
47 enqueue=True,
48 backtrace=True,
49 diagnose=True,
50 compression="zip",
51 catch=True,
52 encoding="utf-8",
53 format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}",
54 )
55 self.info(
56 f"\nMCSL2 - 日志\n本次启动时间: {str(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))}\n{genSysReport()}" # noqa: E501
57 )
58
59 def _getLogFile(self) -> str:
60 return osp.join("MCSL2/Logs", f"MCSL2_{self.time}.log")

Callers

nothing calls this directly

Calls 3

_getLogFileMethod · 0.95
infoMethod · 0.95
genSysReportFunction · 0.85

Tested by

no test coverage detected