Skip to content

Any way to have a specific name for the latest log file, while using a formatting for old ones? #1468

Description

@svioletg

The sink argument I'm using for my file handler is currently this logs_dir / '{time:YYYY-MM-DD_HH-mm-ss}.log', which formats the log file based on the time it was created. I couldn't find this in the documentation so I figured I'd ask here, would there be any way specific to loguru that I can say have the current log file (as in the one that is being written to at present for the course of the script) be named something like latest.log, and then either on exit or at next startup it gets renamed to the time format? If not I can always do this manually, but I wasn't sure if loguru had anything built in for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions