]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Move field width to the right field (GH-29344)
authorOlaf van der Spek <olafvdspek@gmail.com>
Sun, 31 Oct 2021 17:44:23 +0000 (18:44 +0100)
committerGitHub <noreply@github.com>
Sun, 31 Oct 2021 17:44:23 +0000 (10:44 -0700)
Automerge-Triggered-By: GH:vsajip
Doc/library/logging.rst

index ee0276aadcf3d0856016d39c2b987a89e56de1af..3f3a8534f54d0db3c9ff19c5af208567ca6d68f6 100644 (file)
@@ -203,7 +203,7 @@ is the module's name in the Python package namespace.
       attributes can then be used as you like. For example, they could be
       incorporated into logged messages. For example::
 
-         FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
+         FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s'
          logging.basicConfig(format=FORMAT)
          d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
          logger = logging.getLogger('tcpserver')
@@ -1000,7 +1000,7 @@ functions.
    be used as you like. For example, they could be incorporated into logged
    messages. For example::
 
-      FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
+      FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s'
       logging.basicConfig(format=FORMAT)
       d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
       logging.warning('Protocol problem: %s', 'connection reset', extra=d)