[Python-checkins] python/dist/src/Doc/lib liblogging.tex,NONE,1.1

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
Wed, 13 Nov 2002 19:57:21 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv2105

Added Files:
	liblogging.tex 
Log Message:
initial rough cut at documentation of logging module.  This is basically
just a conversion of pydoc.help(logging).



--- NEW FILE: liblogging.tex ---
\section{\module{logging} ---
         Logging facility for Python}

\declaremodule{standard}{logging}	% standard library, in Python

% These apply to all modules, and may be given more than once:

\moduleauthor{Vinay Sajip}{vinay_sajip@red-dove.com}
\sectionauthor{Skip Montanaro}{skip@pobox.com}

\modulesynopsis{Logging module for Python based on PEP 282.}


There is a need for a standard logging system in Python, as documented in
{}\pep{282} and enthusiastically endorsed by the Guido van Rossum in the
{}\citetitle[http://www.python.org/doc/essays/pepparade.html]{Parade of the
PEPs}.  By a happy coincidence, the package described here was already in
development and fairly close in intent and design to the description in the
aforementioned PEP, borrowing as it did heavily from JSR-47 (now JDK 1.4's
[...1100 lines suppressed...]
    mymodule.doIt()
except Exception, e:
    log.exception("There was a problem doin' stuff.")
log.info("end my app")
\end{verbatim}

When you run \code{myapp.py}, the results are:

\begin{verbatim}
2002-03-14 23:40:49,299 MyApp               INFO  - start my app
2002-03-14 23:40:49,299 MyModule            DEBUG - doin' stuff
2002-03-14 23:40:49,299 MyApp               ERROR - There was a problem doin' stuff.
Traceback (innermost last):
  File "myapp.py", line 9, in ?
    mymodule.doIt()
  File "mymodule.py", line 7, in doIt
    raise TypeError, "bogus type error for testing"
TypeError: bogus type error for testing
2002-03-14 23:40:49,409 MyApp               INFO  - end my app
\end{verbatim}