natefinch / lumberjack

lumberjack is a log rolling package for Go
MIT License
4.79k stars 591 forks source link

Handle "stat <filepath>: no such file or directory" error in openExistingOrNew function #213

Open honeychaudharyc opened 1 month ago

honeychaudharyc commented 1 month ago

Description https://github.com/natefinch/lumberjack/blob/4cb27fcfbb0f35cb48c542c5ea80b7c1d18933d0/lumberjack.go#L269 This does not handle stat <filepath>: no such file or directory error when a file is not present at the location.

Fix - documentation here suggests we should use errors.Is(err, fs.ErrNotExist).