-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-46063: Improve algorithm for computing which rolled-over log file… (GH-30093) #30093
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
Conversation
Lib/test/test_logging.py
Outdated
rotator.namer = lambda name: name.replace('.log', '') + '.log' | ||
for t in times: | ||
files.append('%s.%s.log' % (prefix, t)) | ||
# Open empty files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Open empty files | |
# Create empty files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
Lib/logging/handlers.py
Outdated
# Our files could be just about anything after custom naming, but | ||
# likely candidates are of the form | ||
# foo.log.DATETIME_SUFFIX or foo.DATETIME_SUFFIX.log | ||
if not fileName.startswith(baseName) and fileName.endswith(e) and len(fileName) > (plen + 1) and not fileName[plen+1].isdigit(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very long line, I don't know if you follow PEP 8 here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll shorten it by wrapping over successive lines.
Thanks for the review. |
Yes, that's done (briefly, but I think sufficiently) in the API documentation for |
Thanks @vsajip for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10. |
pythonGH-30093) (cherry picked from commit cb589d1) Co-authored-by: Vinay Sajip <[email protected]>
GH-30094 is a backport of this pull request to the 3.10 branch. |
pythonGH-30093) (cherry picked from commit cb589d1) Co-authored-by: Vinay Sajip <[email protected]>
GH-30095 is a backport of this pull request to the 3.9 branch. |
…og file… (GH-30093) (GH-30094) Co-authored-by: Vinay Sajip <[email protected]>
…s to delete.
https://bugs.python.org/issue46063