##// END OF EJS Templates
blackbox: optionally log event source
timeless -
r28305:f5ae291d default
parent child Browse files
Show More
@@ -18,6 +18,8 b' Examples::'
18 # dirty is *EXPENSIVE* (slow);
18 # dirty is *EXPENSIVE* (slow);
19 # each log entry indicates `+` if the repository is dirty, like :hg:`id`.
19 # each log entry indicates `+` if the repository is dirty, like :hg:`id`.
20 dirty = True
20 dirty = True
21 # record the source of log messages
22 logsource = True
21
23
22 [blackbox]
24 [blackbox]
23 track = command, commandfinish, commandexception, exthook, pythonhook
25 track = command, commandfinish, commandexception, exthook, pythonhook
@@ -174,9 +176,13 b' def wrapui(ui):'
174 any(ctx.sub(s).dirty() for s in ctx.substate)
176 any(ctx.sub(s).dirty() for s in ctx.substate)
175 )):
177 )):
176 changed = '+'
178 changed = '+'
179 if ui.configbool('blackbox', 'logsource', False):
180 src = ' [%s]' % event
181 else:
182 src = ''
177 try:
183 try:
178 ui._bbwrite('%s %s @%s%s (%s)> %s',
184 ui._bbwrite('%s %s @%s%s (%s)%s> %s',
179 date, user, rev, changed, pid, formattedmsg)
185 date, user, rev, changed, pid, src, formattedmsg)
180 except IOError as err:
186 except IOError as err:
181 self.debug('warning: cannot write to blackbox.log: %s\n' %
187 self.debug('warning: cannot write to blackbox.log: %s\n' %
182 err.strerror)
188 err.strerror)
General Comments 0
You need to be logged in to leave comments. Login now