Spaces:
Running
Running
zzstoatzz commited on
Commit ·
c1dbfd7
1
Parent(s): e1f78df
rm random diff
Browse files
src/fastmcp/utilities/logging.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
"""
|
| 2 |
|
| 3 |
import logging
|
| 4 |
from typing import Literal
|
|
@@ -7,12 +7,12 @@ from rich.logging import RichHandler
|
|
| 7 |
|
| 8 |
|
| 9 |
def get_logger(name: str) -> logging.Logger:
|
| 10 |
-
"""
|
| 11 |
|
| 12 |
-
|
| 13 |
name: the name of the logger, which will be prefixed with 'fastmcp.'
|
| 14 |
|
| 15 |
-
|
| 16 |
a configured logger instance
|
| 17 |
"""
|
| 18 |
return logging.getLogger(f"fastmcp.{name}")
|
|
@@ -21,9 +21,9 @@ def get_logger(name: str) -> logging.Logger:
|
|
| 21 |
def configure_logging(
|
| 22 |
level: Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] = "INFO",
|
| 23 |
) -> None:
|
| 24 |
-
"""
|
| 25 |
|
| 26 |
-
|
| 27 |
level: the log level to use
|
| 28 |
"""
|
| 29 |
logging.basicConfig(
|
|
|
|
| 1 |
+
"""Logging utilities for FastMCP."""
|
| 2 |
|
| 3 |
import logging
|
| 4 |
from typing import Literal
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
def get_logger(name: str) -> logging.Logger:
|
| 10 |
+
"""Get a logger nested under fastmcp namespace.
|
| 11 |
|
| 12 |
+
Args:
|
| 13 |
name: the name of the logger, which will be prefixed with 'fastmcp.'
|
| 14 |
|
| 15 |
+
Returns:
|
| 16 |
a configured logger instance
|
| 17 |
"""
|
| 18 |
return logging.getLogger(f"fastmcp.{name}")
|
|
|
|
| 21 |
def configure_logging(
|
| 22 |
level: Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] = "INFO",
|
| 23 |
) -> None:
|
| 24 |
+
"""Configure logging for FastMCP.
|
| 25 |
|
| 26 |
+
Args:
|
| 27 |
level: the log level to use
|
| 28 |
"""
|
| 29 |
logging.basicConfig(
|