MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / warning_advice

Function warning_advice

bmtools/utils/logging.py:253–261  ·  view source on GitHub ↗

This method is identical to ``logger.warning()``, but if env var TRANSFORMERS_NO_ADVISORY_WARNINGS=1 is set, this warning will not be printed

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

251
252
253def warning_advice(self, *args, **kwargs):
254 """
255 This method is identical to ``logger.warning()``, but if env var TRANSFORMERS_NO_ADVISORY_WARNINGS=1 is set, this
256 warning will not be printed
257 """
258 no_advisory_warnings = os.getenv("TRANSFORMERS_NO_ADVISORY_WARNINGS", False)
259 if no_advisory_warnings:
260 return
261 self.warning(*args, **kwargs)
262
263
264logging.Logger.warning_advice = warning_advice

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected