[Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.62, 1.63

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Wed Jul 7 15:01:58 CEST 2004


Update of /cvsroot/python/python/dist/src/Doc/whatsnew
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26017

Modified Files:
	whatsnew24.tex 
Log Message:
Add logging changes

Index: whatsnew24.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -d -r1.62 -r1.63
*** whatsnew24.tex	5 Jul 2004 01:40:07 -0000	1.62
--- whatsnew24.tex	7 Jul 2004 13:01:53 -0000	1.63
***************
*** 783,792 ****
  bookmarking, windowing, or lookahead iterators.
  
  \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:
  
  \begin{verbatim}
--- 783,813 ----
  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:
  
  \begin{verbatim}



More information about the Python-checkins mailing list