mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
Merge: Use PEP-8 style in logging example
This commit is contained in:
commit
8a56085b51
@ -159,7 +159,7 @@ instantiated directly, but always through the module-level function
|
||||
|
||||
FORMAT = '%(asctime)-15s %(clientip)s %(user)-8s %(message)s'
|
||||
logging.basicConfig(format=FORMAT)
|
||||
d = { 'clientip' : '192.168.0.1', 'user' : 'fbloggs' }
|
||||
d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
|
||||
logger = logging.getLogger('tcpserver')
|
||||
logger.warning('Protocol problem: %s', 'connection reset', extra=d)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user