##// END OF EJS Templates
blackbox: initialize logger with repo instance...
Yuya Nishihara -
r40797:567e164f default
parent child Browse files
Show More
@@ -139,14 +139,12 b' class proxylogger(object):'
139 139 _lastlogger = proxylogger()
140 140
141 141 class blackboxlogger(object):
142 def __init__(self, ui):
143 self._repo = None
142 def __init__(self, ui, repo):
143 self._repo = repo
144 144 self._trackedevents = set(ui.configlist('blackbox', 'track'))
145 145
146 146 @property
147 147 def _bbvfs(self):
148 vfs = None
149 if self._repo:
150 148 vfs = self._repo.vfs
151 149 if not vfs.isdir('.'):
152 150 vfs = None
@@ -188,9 +186,6 b' class blackboxlogger(object):'
188 186 ui.debug('warning: cannot write to blackbox.log: %s\n' %
189 187 encoding.strtolocal(err.strerror))
190 188
191 def setrepo(self, repo):
192 self._repo = repo
193
194 189 def uipopulate(ui):
195 190 ui.setlogger(b'blackbox', _lastlogger)
196 191
@@ -203,9 +198,8 b' def reposetup(ui, repo):'
203 198
204 199 # Since blackbox.log is stored in the repo directory, the logger should be
205 200 # instantiated per repository.
206 logger = blackboxlogger(ui)
201 logger = blackboxlogger(ui, repo)
207 202 ui.setlogger(b'blackbox', logger)
208 logger.setrepo(repo)
209 203
210 204 # Set _lastlogger even if ui.log is not called. This gives blackbox a
211 205 # fallback place to log
General Comments 0
You need to be logged in to leave comments. Login now