Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
loguru_snippet.py #python #loguru #logging
from loguru import logger
LOGGING_PATH = 'logs'
STARTED_TIME_STR = datetime.datetime.now().strftime("%m_%d_%Y__%H_%M_%S")
logger.remove()
logger.add(f"{LOGGING_PATH}/model_{STARTED_TIME_STR}.log", level='DEBUG') # Save DEBUG level to a file
logger.add(sys.stdout, level='INFO') # Print INFO level to stdout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.