MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / log_once

Function log_once

tensorpack/utils/argtools.py:129–138  ·  view source on GitHub ↗

Log certain message only once. Call this function more than one times with the same message will result in no-op. Args: message(str): message to log func(str): the name of the logger method. e.g. "info", "warn", "error".

(message, func='info')

Source from the content-addressed store, hash-verified

127
128@memoized
129def log_once(message, func='info'):
130 """
131 Log certain message only once. Call this function more than one times with
132 the same message will result in no-op.
133
134 Args:
135 message(str): message to log
136 func(str): the name of the logger method. e.g. "info", "warn", "error".
137 """
138 getattr(logger, func)(message)
139
140
141def call_only_once(func):

Callers 9

__call__Method · 0.90
enable_death_signalFunction · 0.85
start_proc_mask_signalFunction · 0.85
decoderFunction · 0.85
__str__Method · 0.85
get_transformMethod · 0.85
__repr__Method · 0.85
BatchNormFunction · 0.85
Conv2DFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected