MCPcopy
hub / github.com/ByteDance-Seed/Depth-Anything-3 / log

Method log

src/depth_anything_3/utils/logger.py:41–59  ·  view source on GitHub ↗
(self, level_str, *args, **kwargs)

Source from the content-addressed store, hash-verified

39 self.level = get_env_log_level()
40
41 def log(self, level_str, *args, **kwargs):
42 level_key = level_str.split(":")[0].strip()
43 level_val = LOG_LEVELS.get(level_key)
44 if level_val is None:
45 raise ValueError(f"Unknown log level: {level_str}")
46 if self.level >= level_val:
47 color = COLOR_MAP[level_key]
48 msg = " ".join(str(arg) for arg in args)
49
50 # Align log level output in square brackets
51 # ERROR and DEBUG are 5 characters, INFO and WARN have an extra space for alignment
52 tag = level_key
53 if tag in ("INFO", "WARN"):
54 tag += " "
55 print(
56 f"{color}[{tag}] {msg}{Color.RESET}",
57 file=sys.stderr if level_key == "ERROR" else sys.stdout,
58 **kwargs,
59 )
60
61 def error(self, *args, **kwargs):
62 self.log("ERROR:", *args, **kwargs)

Callers 8

errorMethod · 0.95
warnMethod · 0.95
infoMethod · 0.95
debugMethod · 0.95
compute_scale_weightedFunction · 0.80
export_plyFunction · 0.80
inverse_sigmoidFunction · 0.80
vis_depth_map_tensorFunction · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected