MCPcopy
hub / github.com/ray-project/ray / clear_loggers

Function clear_loggers

python/ray/_common/tests/test_usage_stats.py:494–503  ·  view source on GitHub ↗

Remove handlers from all loggers

()

Source from the content-addressed store, hash-verified

492
493@pytest.fixture
494def clear_loggers():
495 """Remove handlers from all loggers"""
496 yield
497 import logging
498
499 loggers = [logging.getLogger()] + list(logging.Logger.manager.loggerDict.values())
500 for logger in loggers:
501 handlers = getattr(logger, "handlers", [])
502 for handler in handlers:
503 logger.removeHandler(handler)
504
505
506# NOTE: We are clearing loggers because otherwise, the next test's

Callers

nothing calls this directly

Calls 2

listFunction · 0.85
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…