Source code for smefit.log

# -*- coding: utf-8 -*-
import inspect
import logging

import rich.align
from rich.console import Console
from rich.logging import RichHandler

logging.basicConfig(
    level=logging.INFO,
    format="%(message)s",
    datefmt="[%X]",
    handlers=[RichHandler()],
)


[docs] def setup_console(logfile): global console if logfile is not None: log_object = open(logfile, "w", encoding="utf-8") else: log_object = None console = Console( file=log_object, )