Respect documentation on passive log level (#21700)

* Respect documentation on passive log level

* Fix test and set log level in examples

* Add doc
This commit is contained in:
Sylvain Gugger
2023-02-22 09:39:18 +01:00
committed by GitHub
parent ee6e71e29c
commit b19d64d852
20 changed files with 85 additions and 9 deletions

View File

@@ -1098,11 +1098,11 @@ class TrainerIntegrationTest(TestCasePlus, TrainerIntegrationCommon):
logger = logging.get_logger()
log_info_string = "Running training"
# test with the default log_level - should be info and thus log on the main process
# test with the default log_level - should be warning and thus not log on the main process
with CaptureLogger(logger) as cl:
trainer = get_regression_trainer()
trainer.train()
self.assertIn(log_info_string, cl.out)
self.assertNotIn(log_info_string, cl.out)
# test with low log_level - lower than info
with CaptureLogger(logger) as cl: