Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5d512fa2
Commit
5d512fa2
authored
Oct 24, 2007
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1321: Fixed logic error in TimedRotatingFileHandler.__init__()
parent
4b2a6dbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Lib/logging/handlers.py
Lib/logging/handlers.py
+7
-7
No files found.
Lib/logging/handlers.py
View file @
5d512fa2
# Copyright 2001-200
5
by Vinay Sajip. All Rights Reserved.
# Copyright 2001-200
7
by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
...
...
@@ -22,7 +22,7 @@ Apache's log4j system.
Should work under Python versions >= 1.5.2, except that source line
information is not available unless 'sys._getframe()' is.
Copyright (C) 2001-200
4
Vinay Sajip. All Rights Reserved.
Copyright (C) 2001-200
7
Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
...
...
@@ -231,11 +231,11 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
# of days in the next week until the rollover day (3).
if
when
.
startswith
(
'W'
):
day
=
t
[
6
]
# 0 is Monday
if
day
>
self
.
dayOfWeek
:
daysToWait
=
(
day
-
self
.
dayOfWeek
)
-
1
self
.
rolloverAt
=
self
.
rolloverAt
+
(
daysToWait
*
(
60
*
60
*
24
))
if
day
<
self
.
dayOfWeek
:
daysToWait
=
(
6
-
self
.
dayOfWeek
)
+
day
if
day
!=
self
.
dayOfWeek
:
if
day
<
self
.
dayOfWeek
:
daysToWait
=
self
.
dayOfWeek
-
day
-
1
else
:
daysToWait
=
6
-
day
+
self
.
dayOfWeek
self
.
rolloverAt
=
self
.
rolloverAt
+
(
daysToWait
*
(
60
*
60
*
24
))
#print "Will rollover at %d, %d seconds from now" % (self.rolloverAt, self.rolloverAt - currentTime)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment