loguru icon indicating copy to clipboard operation
loguru copied to clipboard

make get_ctime() public to be easier to write rotation function

Open mhama opened this issue 1 month ago • 0 comments

I'm using a custom rotation function at loguru initialization. (I just wanted to impose both time and size restriction) In the custom rotation function, the implementation uses the creation time of the current log file. I want to implement using platform-neutral way of getting creation time, but it is not exist in python standard libraries. In loguru, get_ctime is the platform-neutal way of getting file creation time of log files. So I want to use it.

But it looks like it is private module as the .py file starts with "_", and it looks like bad thing to import private functions. So please make _ctime_functions.py public, or expose public accessor to get_ctime like maybe get_current_log_ctime(). It will be much easier/safer to write custom rotation functions with get_ctime().

mhama avatar Dec 04 '25 13:12 mhama