Skip to content

Commit 3e65830

Browse files
andresdelfinovsajip
authored andcommitted
Make StreamHandler.terminator more discoverable (GH-14359)
1 parent 18a2fc6 commit 3e65830

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Doc/library/logging.handlers.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ and :meth:`flush` methods).
4848
.. method:: emit(record)
4949

5050
If a formatter is specified, it is used to format the record. The record
51-
is then written to the stream with a terminator. If exception information
51+
is then written to the stream followed by :attr:`terminator`. If exception information
5252
is present, it is formatted using :func:`traceback.print_exception` and
5353
appended to the stream.
5454

@@ -70,13 +70,17 @@ and :meth:`flush` methods).
7070

7171
.. versionadded:: 3.7
7272

73+
.. attribute:: terminator
7374

74-
.. versionchanged:: 3.2
75-
The ``StreamHandler`` class now has a ``terminator`` attribute, default
76-
value ``'\n'``, which is used as the terminator when writing a formatted
77-
record to a stream. If you don't want this newline termination, you can
78-
set the handler instance's ``terminator`` attribute to the empty string.
79-
In earlier versions, the terminator was hardcoded as ``'\n'``.
75+
String used as the terminator when writing a formatted record to a stream.
76+
Default value is ``'\n'``.
77+
78+
If you don't want a newline termination, you can set the handler instance's
79+
``terminator`` attribute to the empty string.
80+
81+
In earlier versions, the terminator was hardcoded as ``'\n'``.
82+
83+
.. versionadded:: 3.2
8084

8185

8286
.. _file-handler:

0 commit comments

Comments
 (0)