]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] Move field width to the right field (GH-29344) (GH-29350)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 31 Oct 2021 20:25:21 +0000 (13:25 -0700)
committerGitHub <noreply@github.com>
Sun, 31 Oct 2021 20:25:21 +0000 (20:25 +0000)
Co-authored-by: Olaf van der Spek <olafvdspek@gmail.com>
Doc/library/logging.rst

index 1a4c84e4a3a217d3e5f8df14afec101361fe3362..e72a898a11363df7d09e8b0088ad770d45e5e5f7 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')
@@ -993,7 +993,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)