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)
| 251 | |
| 252 | |
| 253 | def 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 | |
| 264 | logging.Logger.warning_advice = warning_advice |
nothing calls this directly
no outgoing calls
no test coverage detected