chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:17:40 +08:00
commit f1825c8ceb
10096 changed files with 2364182 additions and 0 deletions
@@ -0,0 +1,26 @@
import logging
from ray._common.filters import CoreContextFilter
from ray._common.formatters import JSONFormatter
def _configure_stdlib_logging():
"""Configures stdlib root logger to make sure stdlib loggers (created as
`logging.getLogger(...)`) are using Ray's `JSONFormatter` with Core and Serve
context filters.
"""
handler = logging.StreamHandler()
handler.addFilter(CoreContextFilter())
handler.setFormatter(JSONFormatter())
root_logger = logging.getLogger()
# NOTE: It's crucial we reset all the handlers of the root logger,
# to make sure that logs aren't emitted twice
root_logger.handlers = []
root_logger.addHandler(handler)
root_logger.setLevel(logging.INFO)
def setup_logging():
_configure_stdlib_logging()