Puppy icon indicating copy to clipboard operation
Puppy copied to clipboard

Add optional file protection + backup exclusion to FileLoggerable

Open richardhenry opened this issue 1 year ago • 6 comments

This PR adds optional file protection and backup exclusion to FileLogger and FileRotationLogger. To my knowledge, these features are only available on Apple platforms, so the tests I've added will only run on those platforms. Maybe these features should be entirely gated behind compile-time checks? Open to feedback.

richardhenry avatar Feb 07 '24 21:02 richardhenry

I also added flushMode and writeMode to FileRotationLogger because those seem to be missing (FileLogger supports this).

richardhenry avatar Feb 07 '24 23:02 richardhenry

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.26%. Comparing base (510741f) to head (f71641d).

:exclamation: Current head f71641d differs from pull request most recent head c3bda25. Consider uploading reports for the commit c3bda25 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
+ Coverage   97.18%   97.26%   +0.08%     
==========================================
  Files          12       12              
  Lines         639      658      +19     
==========================================
+ Hits          621      640      +19     
  Misses         18       18              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 08 '24 23:02 codecov[bot]

Hello, can I get the kill and background mode logs if I use this package? please anyone, help me

karthickrohan avatar Feb 27 '24 15:02 karthickrohan

Hi @sushichop, do you think this would be a good idea to merge into main?

Do you think it makes sense to put these initializer arguments behind a compile-time check so that this can be mergeable? If so I could make that change.

Let me know what you think.

richardhenry avatar Mar 12 '24 20:03 richardhenry

@richardhenry it can be wrapped in eg #if os(iOS) || os(macOS) || [...]

aehlke avatar Mar 13 '24 00:03 aehlke

@sushichop Thanks, should be fixed — can you trigger another test run?

richardhenry avatar Apr 20 '24 04:04 richardhenry