Any way to have a specific name for the latest log file, while using a formatting for old ones?
Author: svioletgCreated Apr 12, 2026Updated Aug 23, 2026
Labelsquestion
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.
Source: Delgan/loguru