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
bcefe698
Kaydet (Commit)
bcefe698
authored
Tem 07, 2004
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add logging changes
üst
6fe93cde
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
whatsnew24.tex
Doc/whatsnew/whatsnew24.tex
+23
-2
No files found.
Doc/whatsnew/whatsnew24.tex
Dosyayı görüntüle @
bcefe698
...
...
@@ -782,12 +782,33 @@ If the separation is large, then you might as well use
another,
\function
{
tee()
}
is ideal. Possible applications include
bookmarking, windowing, or lookahead iterators.
\item
A
\function
{
basicConfig
}
function was added to the
\module
{
logging
}
package to simplify log configuration. It defaults
to logging to standard error, but a
number of optional keyword arguments can be specified to
log to a particular file, change the logging format, or set the
logging level. For example:
\begin{verbatim}
import logging
logging.basicConfig(filename = '/var/log/application.log',
level=0, # Log all messages, including debugging,
format='
%(levelname):%(process):%(thread):%(message)')
\end{verbatim}
Another addition to
\module
{
logging
}
is a
\class
{
TimedRotatingFileHandler
}
class which rotates its log files at
a timed interval. The module already had
\class
{
RotatingFileHandler
}
,
which rotated logs once the file exceeded a certain size. Both
classes derive from a new
\class
{
BaseRotatingHandler
}
class that can
be used to implement other rotating handlers.
\item
The
\module
{
operator
}
module gained two new functions,
\function
{
attrgetter(
\var
{
attr
}
)
}
and
\function
{
itemgetter(
\var
{
index
}
)
}
.
Both functions return callables that take a single argument and return
the corresponding attribute or item; these callables make excellent
data extractors when used with
\function
{
map()
}
or
\function
{
sorted()
}
.
For example:
data extractors when used with
\function
{
map()
}
or
\function
{
sorted()
}
.
For example:
\begin{verbatim}
>>> L = [('c', 2), ('d', 1), ('a', 4), ('b', 3)]
...
...
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