chore: import upstream snapshot with attribution
Lint / lint (push) Has been cancelled
Build Docs / Deploy Docs (push) Has been cancelled
Windows CI / Windows (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:23:58 +08:00
commit 770d92cb1f
694 changed files with 114634 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
"""
Logging support for MLC. It derives from Python's logging module, and in the future,
it can be easily replaced by other logging modules such as structlog.
"""
import logging
import os
def enable_logging():
"""Enable MLC's default logging format"""
if os.getenv("MLC_UNSET_LOGGING"):
return
logging.basicConfig(
level=logging.INFO,
style="{",
datefmt="%Y-%m-%d %H:%M:%S",
format="[{asctime}] {levelname} {filename}:{lineno}: {message}",
)
def getLogger(name: str):
"""Get a logger according to the given name"""
return logging.getLogger(name)