myLightningOPD / slime /utils /logging_utils.py
ayh015's picture
Upload folder using huggingface_hub
6011e08 verified
Raw
History Blame Contribute Delete
536 Bytes
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import logging
_LOGGER_CONFIGURED = False
# ref: SGLang
def configure_logger(prefix: str = ""):
global _LOGGER_CONFIGURED
if _LOGGER_CONFIGURED:
return
_LOGGER_CONFIGURED = True
logging.basicConfig(
level=logging.INFO,
format=f"[%(asctime)s{prefix}] %(filename)s:%(lineno)d - %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
force=True,
)