@@ -707,6 +707,7 @@ the :class:`LogRecord` being processed. Obviously changing the LogRecord needs
707
707
to be done with some care, but it does allow the injection of contextual
708
708
information into logs (see :ref: `filters-contextual `).
709
709
710
+
710
711
.. _log-record :
711
712
712
713
LogRecord Objects
@@ -722,32 +723,54 @@ wire).
722
723
723
724
Contains all the information pertinent to the event being logged.
724
725
725
- The primary information is passed in :attr: `msg ` and :attr: `args `, which
726
- are combined using ``msg % args `` to create the :attr: `message ` field of the
727
- record.
728
-
729
- :param name: The name of the logger used to log the event represented by
730
- this LogRecord. Note that this name will always have this
731
- value, even though it may be emitted by a handler attached to
732
- a different (ancestor) logger.
733
- :param level: The numeric level of the logging event (one of DEBUG, INFO etc.)
734
- Note that this is converted to *two * attributes of the LogRecord:
735
- ``levelno `` for the numeric value and ``levelname `` for the
736
- corresponding level name.
737
- :param pathname: The full pathname of the source file where the logging call
738
- was made.
739
- :param lineno: The line number in the source file where the logging call was
740
- made.
741
- :param msg: The event description message, possibly a format string with
742
- placeholders for variable data.
743
- :param args: Variable data to merge into the *msg * argument to obtain the
744
- event description.
726
+ The primary information is passed in *msg * and *args *,
727
+ which are combined using ``msg % args `` to create
728
+ the :attr: `!message ` attribute of the record.
729
+
730
+ :param name: The name of the logger used to log the event
731
+ represented by this :class: `!LogRecord `.
732
+ Note that the logger name in the :class: `!LogRecord `
733
+ will always have this value,
734
+ even though it may be emitted by a handler
735
+ attached to a different (ancestor) logger.
736
+ :type name: str
737
+
738
+ :param level: The :ref: `numeric level <levels >` of the logging event
739
+ (such as ``10 `` for ``DEBUG ``, ``20 `` for ``INFO ``, etc).
740
+ Note that this is converted to *two * attributes of the LogRecord:
741
+ :attr: `!levelno ` for the numeric value
742
+ and :attr: `!levelname ` for the corresponding level name.
743
+ :type level: int
744
+
745
+ :param pathname: The full string path of the source file
746
+ where the logging call was made.
747
+ :type pathname: str
748
+
749
+ :param lineno: The line number in the source file
750
+ where the logging call was made.
751
+ :type lineno: int
752
+
753
+ :param msg: The event description message,
754
+ which can be a %-format string with placeholders for variable data.
755
+ :type msg: str
756
+
757
+ :param args: Variable data to merge into the *msg * argument
758
+ to obtain the event description.
759
+ :type args: tuple | dict[str, typing.Any]
760
+
745
761
:param exc_info: An exception tuple with the current exception information,
746
- or ``None `` if no exception information is available.
747
- :param func: The name of the function or method from which the logging call
748
- was invoked.
749
- :param sinfo: A text string representing stack information from the base of
750
- the stack in the current thread, up to the logging call.
762
+ as returned by :func: `sys.exc_info `,
763
+ or ``None `` if no exception information is available.
764
+ :type exc_info: tuple[type[BaseException], BaseException, types.TracebackType] | None
765
+
766
+ :param func: The name of the function or method
767
+ from which the logging call was invoked.
768
+ :type func: str | None
769
+
770
+ :param sinfo: A text string representing stack information
771
+ from the base of the stack in the current thread,
772
+ up to the logging call.
773
+ :type sinfo: str | None
751
774
752
775
.. method :: getMessage()
753
776
0 commit comments