Skip to content

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

@mhama

Description

@mhama

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to an already existing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions