[Python] Loguru - how to clear the logs

Discussão em 'Python' iniciado por Stack, Junho 5, 2025.

  1. Stack

    Stack Membro Participativo

    is there a way clear the log file before using it with the python log library 'loguru'?

    Thanks!

    from loguru import logger
    # clear the log before logging
    logger.add('output.log', format="{time:YYYY-MM-DD HH:mm:ss} {level} {message}")
    logger.debug('my message')

    Continue reading...

Compartilhe esta Página