New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileRotationLogger crashes when archiving full log files #10
Comments
@tucknology
This is another good idea! Thanks. |
I'm closing this issue since it was fixed by #11, Thanks. |
I have adde this feature. See #32. Thanks. |
I have released Puppy@0.4.0 that fixes this issue. Thanks. |
Hi!
In
FileRotationLogger.swift
the functionrotateFiles()
fails at line 109 during the following instruction:This happens because in
Formatter.swift
the functiondateFormatter(_:, locale:, dateFormat:, timeZone:)
creates a timestamp that includes colons (:
) which the file system does not like.One potential solution is changing the
dateFormat
in line 13 ofFormatter.swift
from"yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
to"yyyy-MM-dd'T'HH-mm-ss.SSS"
. This removes the explicit colons in the original date format string, as well as an implicit colon which is added byZZZZZ
which expands to anHH:MM
style presentation of the timezone.You might also consider reducing the complexity of this string further, since I'd argue if a detailed timestamp is necessary then it can be placed inside the log file, rather than in the file name.
One alternative could be to structure like this:
This proposal would simplify the implementation of the rest of the
rotateFiles
method that is concerned with removing old archived files.The text was updated successfully, but these errors were encountered: