@@ -579,7 +579,7 @@ information. When you call one of the logging methods on an instance of
579579information in the delegated call. Here's a snippet from the code of
580580:class: `LoggerAdapter `::
581581
582- def debug(self, msg, *args, **kwargs):
582+ def debug(self, msg, /, *args, **kwargs):
583583 """
584584 Delegate a debug call to the underlying logger, after adding
585585 contextual information from this adapter instance.
@@ -1079,7 +1079,7 @@ call ``str()`` on that object to get the actual format string. Consider the
10791079following two classes::
10801080
10811081 class BraceMessage:
1082- def __init__(self, fmt, *args, **kwargs):
1082+ def __init__(self, fmt, /, *args, **kwargs):
10831083 self.fmt = fmt
10841084 self.args = args
10851085 self.kwargs = kwargs
@@ -1088,7 +1088,7 @@ following two classes::
10881088 return self.fmt.format(*self.args, **self.kwargs)
10891089
10901090 class DollarMessage:
1091- def __init__(self, fmt, **kwargs):
1091+ def __init__(self, fmt, /, **kwargs):
10921092 self.fmt = fmt
10931093 self.kwargs = kwargs
10941094
@@ -1143,7 +1143,7 @@ to the above, as in the following example::
11431143
11441144 import logging
11451145
1146- class Message(object) :
1146+ class Message:
11471147 def __init__(self, fmt, args):
11481148 self.fmt = fmt
11491149 self.args = args
@@ -1155,7 +1155,7 @@ to the above, as in the following example::
11551155 def __init__(self, logger, extra=None):
11561156 super(StyleAdapter, self).__init__(logger, extra or {})
11571157
1158- def log(self, level, msg, *args, **kwargs):
1158+ def log(self, level, msg, /, *args, **kwargs):
11591159 if self.isEnabledFor(level):
11601160 msg, kwargs = self.process(msg, kwargs)
11611161 self.logger._log(level, Message(msg, args), (), **kwargs)
@@ -1301,7 +1301,7 @@ You can also subclass :class:`QueueListener` to get messages from other kinds
13011301of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::
13021302
13031303 class ZeroMQSocketListener(QueueListener):
1304- def __init__(self, uri, *handlers, **kwargs):
1304+ def __init__(self, uri, /, *handlers, **kwargs):
13051305 self.ctx = kwargs.get('ctx') or zmq.Context()
13061306 socket = zmq.Socket(self.ctx, zmq.SUB)
13071307 socket.setsockopt_string(zmq.SUBSCRIBE, '') # subscribe to everything
@@ -1706,8 +1706,8 @@ which uses JSON to serialise the event in a machine-parseable manner::
17061706 import json
17071707 import logging
17081708
1709- class StructuredMessage(object) :
1710- def __init__(self, message, **kwargs):
1709+ class StructuredMessage:
1710+ def __init__(self, message, /, **kwargs):
17111711 self.message = message
17121712 self.kwargs = kwargs
17131713
@@ -1750,8 +1750,8 @@ as in the following complete example::
17501750 return o.encode('unicode_escape').decode('ascii')
17511751 return super(Encoder, self).default(o)
17521752
1753- class StructuredMessage(object) :
1754- def __init__(self, message, **kwargs):
1753+ class StructuredMessage:
1754+ def __init__(self, message, /, **kwargs):
17551755 self.message = message
17561756 self.kwargs = kwargs
17571757
@@ -1982,17 +1982,17 @@ object as a message format string, and that the logging package will call
19821982:func: `str ` on that object to get the actual format string. Consider the
19831983following two classes::
19841984
1985- class BraceMessage(object) :
1986- def __init__(self, fmt, *args, **kwargs):
1985+ class BraceMessage:
1986+ def __init__(self, fmt, /, *args, **kwargs):
19871987 self.fmt = fmt
19881988 self.args = args
19891989 self.kwargs = kwargs
19901990
19911991 def __str__(self):
19921992 return self.fmt.format(*self.args, **self.kwargs)
19931993
1994- class DollarMessage(object) :
1995- def __init__(self, fmt, **kwargs):
1994+ class DollarMessage:
1995+ def __init__(self, fmt, /, **kwargs):
19961996 self.fmt = fmt
19971997 self.kwargs = kwargs
19981998
@@ -2457,7 +2457,7 @@ scope of the context manager::
24572457 import logging
24582458 import sys
24592459
2460- class LoggingContext(object) :
2460+ class LoggingContext:
24612461 def __init__(self, logger, level=None, handler=None, close=True):
24622462 self.logger = logger
24632463 self.level = level
0 commit comments