Mercurial > hg
comparison mercurial/loggingutil.py @ 48946:642e31cb55f0
py3: use class X: instead of class X(object):
The inheritance from object is implied in Python 3. So this should
be equivalent.
This change was generated via an automated search and replace. So there
may have been some accidental changes.
Differential Revision: https://phab.mercurial-scm.org/D12352
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 13:08:28 -0700 |
parents | 6000f5b25c9b |
children | d44e3c45f0e4 |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
71 | 71 |
72 def _matchevent(event, tracked): | 72 def _matchevent(event, tracked): |
73 return b'*' in tracked or event in tracked | 73 return b'*' in tracked or event in tracked |
74 | 74 |
75 | 75 |
76 class filelogger(object): | 76 class filelogger: |
77 """Basic logger backed by physical file with optional rotation""" | 77 """Basic logger backed by physical file with optional rotation""" |
78 | 78 |
79 def __init__(self, vfs, name, tracked, maxfiles=0, maxsize=0): | 79 def __init__(self, vfs, name, tracked, maxfiles=0, maxsize=0): |
80 self._vfs = vfs | 80 self._vfs = vfs |
81 self._name = name | 81 self._name = name |
102 b'cannot write to %s: %s\n' | 102 b'cannot write to %s: %s\n' |
103 % (self._name, stringutil.forcebytestr(err)) | 103 % (self._name, stringutil.forcebytestr(err)) |
104 ) | 104 ) |
105 | 105 |
106 | 106 |
107 class fileobjectlogger(object): | 107 class fileobjectlogger: |
108 """Basic logger backed by file-like object""" | 108 """Basic logger backed by file-like object""" |
109 | 109 |
110 def __init__(self, fp, tracked): | 110 def __init__(self, fp, tracked): |
111 self._fp = fp | 111 self._fp = fp |
112 self._trackedevents = set(tracked) | 112 self._trackedevents = set(tracked) |
127 stringutil.forcebytestr(err), | 127 stringutil.forcebytestr(err), |
128 ) | 128 ) |
129 ) | 129 ) |
130 | 130 |
131 | 131 |
132 class proxylogger(object): | 132 class proxylogger: |
133 """Forward log events to another logger to be set later""" | 133 """Forward log events to another logger to be set later""" |
134 | 134 |
135 def __init__(self): | 135 def __init__(self): |
136 self.logger = None | 136 self.logger = None |
137 | 137 |