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