MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / _should_log

Method _should_log

parallel/logging.py:13–19  ·  view source on GitHub ↗

Check if log should be performed.

(main_process_only)

Source from the content-addressed store, hash-verified

11
12 @staticmethod
13 def _should_log(main_process_only):
14 """Check if log should be performed."""
15 if not dist.is_available() or not dist.is_initialized():
16 is_main_process = True
17 else:
18 is_main_process = dist.get_rank() == 0
19 return not main_process_only or (main_process_only and is_main_process)
20
21 def log(self, level, msg, *args, **kwargs):
22 """Delegates logger call after checking if we should log.

Callers 1

logMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected