MCPcopy
hub / github.com/microsoft/RD-Agent / _log

Method _log

rdagent/log/logger.py:114–127  ·  view source on GitHub ↗
(self, level: str, msg: str, *, tag: str = "", raw: bool = False)

Source from the content-addressed store, hash-verified

112 storage.log(obj, tag=tag)
113
114 def _log(self, level: str, msg: str, *, tag: str = "", raw: bool = False) -> None:
115 caller_info = get_caller_info(level=3)
116 tag = f"{self._tag}.{tag}.{self.get_pids()}".strip(".")
117
118 if raw:
119 logger.remove()
120 logger.add(sys.stderr, format=lambda r: "{message}")
121
122 log_func = getattr(logger.patch(lambda r: r.update(caller_info)), level)
123 log_func(msg)
124
125 if raw:
126 logger.remove()
127 logger.add(sys.stderr)
128
129 def info(self, msg: str, *, tag: str = "", raw: bool = False) -> None:
130 self._log("info", msg, tag=tag, raw=raw)

Callers 3

infoMethod · 0.95
warningMethod · 0.95
errorMethod · 0.95

Calls 4

get_pidsMethod · 0.95
get_caller_infoFunction · 0.85
updateMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected