Commit 82a63847 authored by Vinay Sajip's avatar Vinay Sajip Committed by GitHub

Indented Handler sections for improved clarity. (#1554)

Indented parts of the Handler class documentation for improved presentation, analogous to a recent similar change for the Logger class.
parent 31b3901a
......@@ -71,11 +71,11 @@ is the module's name in the Python package namespace.
.. attribute:: Logger.propagate
If this evaluates to true, events logged to this logger will be passed to the
handlers of higher level (ancestor) loggers, in addition to any handlers
attached to this logger. Messages are passed directly to the ancestor
loggers' handlers - neither the level nor filters of the ancestor loggers in
question are considered.
If this attribute evaluates to true, events logged to this logger will be
passed to the handlers of higher level (ancestor) loggers, in addition to
any handlers attached to this logger. Messages are passed directly to the
ancestor loggers' handlers - neither the level nor filters of the ancestor
loggers in question are considered.
If this evaluates to false, logging messages are not passed to the handlers
of ancestor loggers.
......@@ -362,31 +362,32 @@ is never instantiated directly; this class acts as a base for more useful
subclasses. However, the :meth:`__init__` method in subclasses needs to call
:meth:`Handler.__init__`.
.. class:: Handler
.. method:: Handler.__init__(level=NOTSET)
.. method:: Handler.__init__(level=NOTSET)
Initializes the :class:`Handler` instance by setting its level, setting the list
of filters to the empty list and creating a lock (using :meth:`createLock`) for
serializing access to an I/O mechanism.
.. method:: Handler.createLock()
.. method:: Handler.createLock()
Initializes a thread lock which can be used to serialize access to underlying
I/O functionality which may not be threadsafe.
.. method:: Handler.acquire()
.. method:: Handler.acquire()
Acquires the thread lock created with :meth:`createLock`.
.. method:: Handler.release()
.. method:: Handler.release()
Releases the thread lock acquired with :meth:`acquire`.
.. method:: Handler.setLevel(lvl)
.. method:: Handler.setLevel(lvl)
Sets the threshold for this handler to *lvl*. Logging messages which are less
severe than *lvl* will be ignored. When a handler is created, the level is set
......@@ -400,22 +401,22 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call
such as :const:`INFO`.
.. method:: Handler.setFormatter(form)
.. method:: Handler.setFormatter(form)
Sets the :class:`Formatter` for this handler to *form*.
.. method:: Handler.addFilter(filt)
.. method:: Handler.addFilter(filt)
Adds the specified filter *filt* to this handler.
.. method:: Handler.removeFilter(filt)
.. method:: Handler.removeFilter(filt)
Removes the specified filter *filt* from this handler.
.. method:: Handler.filter(record)
.. method:: Handler.filter(record)
Applies this handler's filters to the record and returns a true value if the
record is to be processed. The filters are consulted in turn, until one of
......@@ -424,13 +425,13 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call
record.
.. method:: Handler.flush()
.. method:: Handler.flush()
Ensure all logging output has been flushed. This version does nothing and is
intended to be implemented by subclasses.
.. method:: Handler.close()
.. method:: Handler.close()
Tidy up any resources used by the handler. This version does no output but
removes the handler from an internal list of handlers which is closed when
......@@ -438,14 +439,14 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call
from overridden :meth:`close` methods.
.. method:: Handler.handle(record)
.. method:: Handler.handle(record)
Conditionally emits the specified logging record, depending on filters which may
have been added to the handler. Wraps the actual emission of the record with
acquisition/release of the I/O thread lock.
.. method:: Handler.handleError(record)
.. method:: Handler.handleError(record)
This method should be called from handlers when an exception is encountered
during an :meth:`emit` call. If the module-level attribute
......@@ -458,13 +459,13 @@ subclasses. However, the :meth:`__init__` method in subclasses needs to call
more useful during development).
.. method:: Handler.format(record)
.. method:: Handler.format(record)
Do formatting for a record - if a formatter is set, use it. Otherwise, use the
default formatter for the module.
.. method:: Handler.emit(record)
.. method:: Handler.emit(record)
Do whatever it takes to actually log the specified logging record. This version
is intended to be implemented by subclasses and so raises a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment