Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6b3b046a
Commit
6b3b046a
authored
Apr 09, 2004
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix up some markup
parent
7dacda29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
Doc/lib/liblogging.tex
Doc/lib/liblogging.tex
+18
-18
No files found.
Doc/lib/liblogging.tex
View file @
6b3b046a
...
...
@@ -55,7 +55,7 @@ location (or set of locations) which is useful for the target audience for
that message (such as end users, support desk staff, system administrators,
developers). Handlers are passed
\class
{
LogRecord
}
instances intended for
particular destinations. Each logger can have zero, one or more handlers
associated with it (via the
\method
{
addHandler
}
method of
\class
{
Logger
}
).
associated with it (via the
\method
{
addHandler
()
}
method of
\class
{
Logger
}
).
In addition to any handlers directly associated with a logger,
\emph
{
all handlers associated with all ancestors of the logger
}
are
called to dispatch the message.
...
...
@@ -556,8 +556,8 @@ Closes the socket.
Pickles the record's attribute dictionary and writes it to the socket in
binary format. If there is an error with the socket, silently drops the
packet. If the connection was previously lost, re-establishes the connection.
To unpickle the record at the receiving end into a
LogRecord
, use the
\function
{
makeLogRecord
}
function.
To unpickle the record at the receiving end into a
\class
{
LogRecord
}
, use the
\function
{
makeLogRecord
()
}
function.
\end{methoddesc}
\begin{methoddesc}
{
handleError
}{}
...
...
@@ -597,8 +597,8 @@ and \var{port}.
Pickles the record's attribute dictionary and writes it to the socket in
binary format. If there is an error with the socket, silently drops the
packet.
To unpickle the record at the receiving end into a
LogRecord
, use the
\function
{
makeLogRecord
}
function.
To unpickle the record at the receiving end into a
\class
{
LogRecord
}
, use the
\function
{
makeLogRecord
()
}
function.
\end{methoddesc}
\begin{methoddesc}
{
makeSocket
}{}
...
...
@@ -813,12 +813,12 @@ supplied, the default value of \code{'\%(message)s\e'} is used.
A Formatter can be initialized with a format string which makes use of
knowledge of the
\class
{
LogRecord
}
attributes - such as the default value
mentioned above making use of the fact that the user's message and
arguments are pre-formatted into a
LogRecord
's
\var
{
message
}
arguments are pre-formatted into a
\class
{
LogRecord
}
's
\var
{
message
}
attribute. This format string contains standard python
\%
-style
mapping keys. See section
\ref
{
typesseq-strings
}
, ``String Formatting
Operations,'' for more information on string formatting.
Currently, the useful mapping keys in a
LogRecord
are:
Currently, the useful mapping keys in a
\class
{
LogRecord
}
are:
\begin{tableii}
{
l|l
}{
code
}{
Format
}{
Description
}
\lineii
{
\%
(name)s
}
{
Name of the logger (logging channel).
}
...
...
@@ -836,10 +836,10 @@ Currently, the useful mapping keys in a LogRecord are:
\lineii
{
\%
(module)s
}
{
Module (name portion of filename).
}
\lineii
{
\%
(lineno)d
}
{
Source line number where the logging call was issued
(if available).
}
\lineii
{
\%
(created)f
}
{
Time when the
LogRecord
was created (as
\lineii
{
\%
(created)f
}
{
Time when the
\class
{
LogRecord
}
was created (as
returned by
\function
{
time.time()
}
).
}
\lineii
{
\%
(asctime)s
}
{
Human-readable time when the
LogRecord was created.
By default this is of the form
\lineii
{
\%
(asctime)s
}
{
Human-readable time when the
\class
{
LogRecord
}
was created.
By default this is of the form
``2003-07-08 16:49:45,896'' (the numbers after the
comma are millisecond portion of the time).
}
\lineii
{
\%
(msecs)d
}
{
Millisecond portion of the time when the
...
...
@@ -908,7 +908,7 @@ method.
\subsection
{
LogRecord Objects
}
LogRecord
instances are created every time something is logged. They
\class
{
LogRecord
}
instances are created every time something is logged. They
contain all the information pertinent to the event being logged. The
main information passed in is in msg and args, which are combined
using msg
\%
args to create the message field of the record. The record
...
...
@@ -916,9 +916,9 @@ also includes information such as when the record was created, the
source line where the logging call was made, and any exception
information to be logged.
LogRecord has no methods; it's just a repository for information about the
logging event. The only reason it's a class rather than a dictionary is to
facilitate extension.
\class
{
LogRecord
}
has no methods; it's just a repository for
information about the logging event. The only reason it's a class
rather than a dictionary is to
facilitate extension.
\begin{classdesc}
{
LogRecord
}{
name, lvl, pathname, lineno, msg, args,
exc
_
info
}
...
...
@@ -983,7 +983,7 @@ on the return value from \function{listen()}.
\subsubsection
{
Configuration file format
%
\label
{
logging-config-fileformat
}}
The configuration file format understood by
\function
{
fileConfig
}
is
The configuration file format understood by
\function
{
fileConfig
()
}
is
based on ConfigParser functionality. The file must contain sections
called
\code
{
[loggers]
}
,
\code
{
[handlers]
}
and
\code
{
[formatters]
}
which identify by name the entities of each type which are defined in
...
...
@@ -1180,9 +1180,9 @@ If we look in the file that was created, we'll see something like this:
2003-07-08 16:49:45,896 ERROR We have a problem
\end{verbatim}
The info message was not written to the file
- we called the
\method
{
setLevel
}
method to say we only wanted
\code
{
WARNING
}
or worse, so the info message is
discarded.
The info message was not written to the file
: we called the
\method
{
setLevel()
}
method to say we only wanted
\constant
{
WARNING
}
or
worse, so the info message is
discarded.
The timestamp is of the form
``year-month-day hour:minutes:seconds,milliseconds.''
...
...
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