Skip to content

marvin.utilities.logging

Module for logging utilities.

get_logger cached

Retrieves a logger with the given name, or the root logger if no name is given.

Parameters:

Name Type Description Default
name Optional[str]

The name of the logger to retrieve.

None

Returns:

Type Description
Logger

The logger with the given name, or the root logger if no name is given.

Example

Basic Usage of get_logger

from marvin.utilities.logging import get_logger

logger = get_logger("marvin.test")
logger.info("This is a test") # Output: marvin.test: This is a test

debug_logger = get_logger("marvin.debug")
debug_logger.debug_kv("TITLE", "log message", "green")