Skip to content

logger

logger this module should not exist

get_logger(name)

TODO add summary.

Parameters:

Name Type Description Default
name str

description

required

Returns:

Type Description
logging.Logger

logging.Logger: description

Source code in pyef/logger.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def get_logger(
    name: str,
) -> logging.Logger:
    """TODO add summary.

    Args:
        name (str): _description_

    Returns:
        logging.Logger: _description_
    """
    level = get_option("logging_level")
    logger = logging.getLogger(name)
    shell_handler = RichHandler()
    logger.setLevel(level)
    shell_handler.setLevel(level)
    fmt_shell = "[%(filename)s:%(funcName)s:%(lineno)d] %(message)s"
    shell_formatter = logging.Formatter(fmt_shell)
    shell_handler.setFormatter(shell_formatter)
    logger.addHandler(shell_handler)
    return logger