Skip to content

Log deletion too greedy #195

@gazpachoking

Description

@gazpachoking

Using the file sink, when loguru goes to clean up old logs due to retention setting. It is a bit too greedy with what it thinks are old logs. I am using the filename flexget.log, and the glob for deletion comes out to flexget.*. This strikes me as a bit greedy, and in my particular case it tries to delete a folder called FlexGet.egg-info (which is read only and causes a crash.) The two easy improvements I can see are:

  • Include the extension in the glob
  • Exclude folders

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