Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
dd30830d
Kaydet (Commit)
dd30830d
authored
Agu 24, 2016
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Closes #20124: clarified usage of the atTime parameter in TimedRotatingFileHandler documentation.
üst
250d0e5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
17 deletions
+35
-17
logging.handlers.rst
Doc/library/logging.handlers.rst
+35
-17
No files found.
Doc/library/logging.handlers.rst
Dosyayı görüntüle @
dd30830d
...
@@ -327,21 +327,24 @@ timed intervals.
...
@@ -327,21 +327,24 @@ timed intervals.
You can use the *when* to specify the type of *interval*. The list of possible
You can use the *when* to specify the type of *interval*. The list of possible
values is below. Note that they are not case sensitive.
values is below. Note that they are not case sensitive.
+----------------+-----------------------+
+----------------+----------------------------+-------------------------+
| Value | Type of interval |
| Value | Type of interval | If/how *atTime* is used |
+================+=======================+
+================+============================+=========================+
| ``'S'`` | Seconds |
| ``'S'`` | Seconds | Ignored |
+----------------+-----------------------+
+----------------+----------------------------+-------------------------+
| ``'M'`` | Minutes |
| ``'M'`` | Minutes | Ignored |
+----------------+-----------------------+
+----------------+----------------------------+-------------------------+
| ``'H'`` | Hours |
| ``'H'`` | Hours | Ignored |
+----------------+-----------------------+
+----------------+----------------------------+-------------------------+
| ``'D'`` | Days |
| ``'D'`` | Days | Ignored |
+----------------+-----------------------+
+----------------+----------------------------+-------------------------+
| ``'W0'-'W6'`` | Weekday (0=Monday) |
| ``'W0'-'W6'`` | Weekday (0=Monday) | Used to compute initial |
+----------------+-----------------------+
| | | rollover time |
| ``'midnight'`` | Roll over at midnight |
+----------------+----------------------------+-------------------------+
+----------------+-----------------------+
| ``'midnight'`` | Roll over at midnight, if | Used to compute initial |
| | *atTime* not specified, | rollover time |
| | else at time *atTime* | |
+----------------+----------------------------+-------------------------+
When using weekday-based rotation, specify 'W0' for Monday, 'W1' for
When using weekday-based rotation, specify 'W0' for Monday, 'W1' for
Tuesday, and so on up to 'W6' for Sunday. In this case, the value passed for
Tuesday, and so on up to 'W6' for Sunday. In this case, the value passed for
...
@@ -369,7 +372,23 @@ timed intervals.
...
@@ -369,7 +372,23 @@ timed intervals.
If *atTime* is not ``None``, it must be a ``datetime.time`` instance which
If *atTime* is not ``None``, it must be a ``datetime.time`` instance which
specifies the time of day when rollover occurs, for the cases where rollover
specifies the time of day when rollover occurs, for the cases where rollover
is set to happen "at midnight" or "on a particular weekday".
is set to happen "at midnight" or "on a particular weekday". Note that in
these cases, the *atTime* value is effectively used to compute the *initial*
rollover, and subsequent rollovers would be calculated via the normal
interval calculation.
.. note:: Calculation of the initial rollover time is done when the handler
is initialised. Calculation of subsequent rollover times is done only
when rollover occurs, and rollover occurs only when emitting output. If
this is not kept in mind, it might lead to some confusion. For example,
if an interval of "every minute" is set, that does not mean you will
always see log files with times (in the filename) separated by a minute;
if, during application execution, logging output is generated more
frequently than once a minute, *then* you can expect to see log files
with times separated by a minute. If, on the other hand, logging messages
are only output once every five minutes (say), then there will be gaps in
the file times corresponding to the minutes where no output (and hence no
rollover) occurred.
.. versionchanged:: 3.4
.. versionchanged:: 3.4
*atTime* parameter was added.
*atTime* parameter was added.
...
@@ -382,7 +401,6 @@ timed intervals.
...
@@ -382,7 +401,6 @@ timed intervals.
Does a rollover, as described above.
Does a rollover, as described above.
.. method:: emit(record)
.. method:: emit(record)
Outputs the record to the file, catering for rollover as described above.
Outputs the record to the file, catering for rollover as described above.
...
...
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