@@ -579,7 +579,7 @@ information. When you call one of the logging methods on an instance of
579
579
information in the delegated call. Here's a snippet from the code of
580
580
:class: `LoggerAdapter `::
581
581
582
- def debug(self, msg, *args, **kwargs):
582
+ def debug(self, msg, /, *args, **kwargs):
583
583
"""
584
584
Delegate a debug call to the underlying logger, after adding
585
585
contextual information from this adapter instance.
@@ -1079,7 +1079,7 @@ call ``str()`` on that object to get the actual format string. Consider the
1079
1079
following two classes::
1080
1080
1081
1081
class BraceMessage:
1082
- def __init__(self, fmt, *args, **kwargs):
1082
+ def __init__(self, fmt, /, *args, **kwargs):
1083
1083
self.fmt = fmt
1084
1084
self.args = args
1085
1085
self.kwargs = kwargs
@@ -1088,7 +1088,7 @@ following two classes::
1088
1088
return self.fmt.format(*self.args, **self.kwargs)
1089
1089
1090
1090
class DollarMessage:
1091
- def __init__(self, fmt, **kwargs):
1091
+ def __init__(self, fmt, /, **kwargs):
1092
1092
self.fmt = fmt
1093
1093
self.kwargs = kwargs
1094
1094
@@ -1143,7 +1143,7 @@ to the above, as in the following example::
1143
1143
1144
1144
import logging
1145
1145
1146
- class Message(object) :
1146
+ class Message:
1147
1147
def __init__(self, fmt, args):
1148
1148
self.fmt = fmt
1149
1149
self.args = args
@@ -1155,7 +1155,7 @@ to the above, as in the following example::
1155
1155
def __init__(self, logger, extra=None):
1156
1156
super(StyleAdapter, self).__init__(logger, extra or {})
1157
1157
1158
- def log(self, level, msg, *args, **kwargs):
1158
+ def log(self, level, msg, /, *args, **kwargs):
1159
1159
if self.isEnabledFor(level):
1160
1160
msg, kwargs = self.process(msg, kwargs)
1161
1161
self.logger._log(level, Message(msg, args), (), **kwargs)
@@ -1301,7 +1301,7 @@ You can also subclass :class:`QueueListener` to get messages from other kinds
1301
1301
of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::
1302
1302
1303
1303
class ZeroMQSocketListener(QueueListener):
1304
- def __init__(self, uri, *handlers, **kwargs):
1304
+ def __init__(self, uri, /, *handlers, **kwargs):
1305
1305
self.ctx = kwargs.get('ctx') or zmq.Context()
1306
1306
socket = zmq.Socket(self.ctx, zmq.SUB)
1307
1307
socket.setsockopt_string(zmq.SUBSCRIBE, '') # subscribe to everything
@@ -1706,8 +1706,8 @@ which uses JSON to serialise the event in a machine-parseable manner::
1706
1706
import json
1707
1707
import logging
1708
1708
1709
- class StructuredMessage(object) :
1710
- def __init__(self, message, **kwargs):
1709
+ class StructuredMessage:
1710
+ def __init__(self, message, /, **kwargs):
1711
1711
self.message = message
1712
1712
self.kwargs = kwargs
1713
1713
@@ -1750,8 +1750,8 @@ as in the following complete example::
1750
1750
return o.encode('unicode_escape').decode('ascii')
1751
1751
return super(Encoder, self).default(o)
1752
1752
1753
- class StructuredMessage(object) :
1754
- def __init__(self, message, **kwargs):
1753
+ class StructuredMessage:
1754
+ def __init__(self, message, /, **kwargs):
1755
1755
self.message = message
1756
1756
self.kwargs = kwargs
1757
1757
@@ -1982,17 +1982,17 @@ object as a message format string, and that the logging package will call
1982
1982
:func: `str ` on that object to get the actual format string. Consider the
1983
1983
following two classes::
1984
1984
1985
- class BraceMessage(object) :
1986
- def __init__(self, fmt, *args, **kwargs):
1985
+ class BraceMessage:
1986
+ def __init__(self, fmt, /, *args, **kwargs):
1987
1987
self.fmt = fmt
1988
1988
self.args = args
1989
1989
self.kwargs = kwargs
1990
1990
1991
1991
def __str__(self):
1992
1992
return self.fmt.format(*self.args, **self.kwargs)
1993
1993
1994
- class DollarMessage(object) :
1995
- def __init__(self, fmt, **kwargs):
1994
+ class DollarMessage:
1995
+ def __init__(self, fmt, /, **kwargs):
1996
1996
self.fmt = fmt
1997
1997
self.kwargs = kwargs
1998
1998
@@ -2457,7 +2457,7 @@ scope of the context manager::
2457
2457
import logging
2458
2458
import sys
2459
2459
2460
- class LoggingContext(object) :
2460
+ class LoggingContext:
2461
2461
def __init__(self, logger, level=None, handler=None, close=True):
2462
2462
self.logger = logger
2463
2463
self.level = level
0 commit comments