@@ -520,7 +520,7 @@ custom handlers) are the following configuration methods:
520
520
521
521
* The :meth: `~Handler.setLevel ` method, just as in logger objects, specifies the
522
522
lowest severity that will be dispatched to the appropriate destination. Why
523
- are there two :func: ` setLevel ` methods? The level set in the logger
523
+ are there two :meth: ` ~Handler. setLevel ` methods? The level set in the logger
524
524
determines which severity of messages it will pass to its handlers. The level
525
525
set in each handler determines which messages that handler will send on.
526
526
@@ -774,29 +774,29 @@ What happens if no configuration is provided
774
774
775
775
If no logging configuration is provided, it is possible to have a situation
776
776
where a logging event needs to be output, but no handlers can be found to
777
- output the event. The behaviour of the logging package in these
778
- circumstances is dependent on the Python version.
777
+ output the event.
779
778
780
- For versions of Python prior to 3.2, the behaviour is as follows:
779
+ The event is output using a 'handler of last resort', stored in
780
+ :data: `lastResort `. This internal handler is not associated with any
781
+ logger, and acts like a :class: `~logging.StreamHandler ` which writes the
782
+ event description message to the current value of ``sys.stderr `` (therefore
783
+ respecting any redirections which may be in effect). No formatting is
784
+ done on the message - just the bare event description message is printed.
785
+ The handler's level is set to ``WARNING ``, so all events at this and
786
+ greater severities will be output.
781
787
782
- * If *logging.raiseExceptions * is ``False `` (production mode), the event is
783
- silently dropped.
788
+ .. versionchanged :: 3.2
784
789
785
- * If *logging.raiseExceptions * is ``True `` (development mode), a message
786
- 'No handlers could be found for logger X.Y.Z' is printed once.
790
+ For versions of Python prior to 3.2, the behaviour is as follows:
787
791
788
- In Python 3.2 and later, the behaviour is as follows:
792
+ * If :data: `raiseExceptions ` is ``False `` (production mode), the event is
793
+ silently dropped.
789
794
790
- * The event is output using a 'handler of last resort', stored in
791
- ``logging.lastResort ``. This internal handler is not associated with any
792
- logger, and acts like a :class: `~logging.StreamHandler ` which writes the
793
- event description message to the current value of ``sys.stderr `` (therefore
794
- respecting any redirections which may be in effect). No formatting is
795
- done on the message - just the bare event description message is printed.
796
- The handler's level is set to ``WARNING ``, so all events at this and
797
- greater severities will be output.
795
+ * If :data: `raiseExceptions ` is ``True `` (development mode), a message
796
+ 'No handlers could be found for logger X.Y.Z' is printed once.
798
797
799
- To obtain the pre-3.2 behaviour, ``logging.lastResort `` can be set to ``None ``.
798
+ To obtain the pre-3.2 behaviour,
799
+ :data: `lastResort ` can be set to ``None ``.
800
800
801
801
.. _library-config :
802
802
@@ -998,7 +998,7 @@ Logged messages are formatted for presentation through instances of the
998
998
use with the % operator and a dictionary.
999
999
1000
1000
For formatting multiple messages in a batch, instances of
1001
- :class: `~handlers. BufferingFormatter ` can be used. In addition to the format
1001
+ :class: `BufferingFormatter ` can be used. In addition to the format
1002
1002
string (which is applied to each message in the batch), there is provision for
1003
1003
header and trailer format strings.
1004
1004
@@ -1034,7 +1034,8 @@ checks to see if a module-level variable, :data:`raiseExceptions`, is set. If
1034
1034
set, a traceback is printed to :data: `sys.stderr `. If not set, the exception is
1035
1035
swallowed.
1036
1036
1037
- .. note :: The default value of :data:`raiseExceptions` is ``True``. This is
1037
+ .. note ::
1038
+ The default value of :data: `raiseExceptions ` is ``True ``. This is
1038
1039
because during development, you typically want to be notified of any
1039
1040
exceptions that occur. It's advised that you set :data: `raiseExceptions ` to
1040
1041
``False `` for production usage.
@@ -1072,7 +1073,7 @@ You can write code like this::
1072
1073
expensive_func2())
1073
1074
1074
1075
so that if the logger's threshold is set above ``DEBUG ``, the calls to
1075
- :func: ` expensive_func1 ` and :func: ` expensive_func2 ` are never made.
1076
+ `` expensive_func1 `` and `` expensive_func2 ` ` are never made.
1076
1077
1077
1078
.. note :: In some cases, :meth:`~Logger.isEnabledFor` can itself be more
1078
1079
expensive than you'd like (e.g. for deeply nested loggers where an explicit
0 commit comments