Configure loguru default logger
In order to configure the default logger for loguru Python’s library, e.g set a specific formatter or specify a different ‘sink’ (a.k.a output), you can access it this way:
from loguru import logger
config = {
"handlers": [
{
"sink": sys.stdout,
"format": "<level>{level: <8}</level>|<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>",
}
]
}
logger.configure(**config)