diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2005-07-29 11:52:19 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2005-07-29 11:52:19 (GMT) |
commit | c320c22f79b8f5af7d3fe4e05b1ea6eaf15a4c8b (patch) | |
tree | a0650c753042cfaa121a7419e6b358d7db64b115 /Doc/lib | |
parent | 6eea789fd2ab75c14b02e23713ad380498be0a06 (diff) | |
download | cpython-c320c22f79b8f5af7d3fe4e05b1ea6eaf15a4c8b.zip cpython-c320c22f79b8f5af7d3fe4e05b1ea6eaf15a4c8b.tar.gz cpython-c320c22f79b8f5af7d3fe4e05b1ea6eaf15a4c8b.tar.bz2 |
Documentation added about changes in 2.4 to basicConfig(), including documentation of the keyword arguments. A version change note was also added to the basic example.
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/liblogging.tex | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Doc/lib/liblogging.tex b/Doc/lib/liblogging.tex index cca83ca..3f24092 100644 --- a/Doc/lib/liblogging.tex +++ b/Doc/lib/liblogging.tex @@ -258,13 +258,32 @@ defined by \var{attrdict}. This function is useful for taking a pickled it as a \class{LogRecord} instance at the receiving end. \end{funcdesc} -\begin{funcdesc}{basicConfig}{} +\begin{funcdesc}{basicConfig}{\optional{**kwargs}} Does basic configuration for the logging system by creating a \class{StreamHandler} with a default \class{Formatter} and adding it to the root logger. The functions \function{debug()}, \function{info()}, \function{warning()}, \function{error()} and \function{critical()} will call \function{basicConfig()} automatically if no handlers are defined for the root logger. + +\versionchanged[Formerly, \function{basicConfig} did not take any keyword +arguments]{2.4} + +The following keyword arguments are supported. + +\begin{tableii}{l|l}{code}{Format}{Description} +\lineii{filename}{Specifies that a FileHandler be created, using the +specified filename, rather than a StreamHandler.} +\lineii{filemode}{Specifies the mode to open the file, if filename is +specified (if filemode is unspecified, it defaults to 'a').} +\lineii{format}{Use the specified format string for the handler.} +\lineii{datefmt}{Use the specified date/time format.} +\lineii{level}{Set the root logger level to the specified level.} +\lineii{stream}{Use the specified stream to initialize the StreamHandler. +Note that this argument is incompatible with 'filename' - if both +are present, 'stream' is ignored.} +\end{tableii} + \end{funcdesc} \begin{funcdesc}{shutdown}{} @@ -415,6 +434,9 @@ specialized \class{LogRecord} instances. \subsection{Basic example \label{minimal-example}} +\versionchanged[formerly \function{basicConfig} did not take any keyword +arguments]{2.4} + The \module{logging} package provides a lot of flexibility, and its configuration can appear daunting. This section demonstrates that simple use of the logging package is possible. |