Mercurial > hg
changeset 28305:f5ae291dfedf
blackbox: optionally log event source
author | timeless <timeless@mozdev.org> |
---|---|
date | Thu, 11 Feb 2016 19:38:26 +0000 |
parents | 6b38888ab033 |
children | 1778770e1982 |
files | hgext/blackbox.py |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/blackbox.py Tue Mar 01 10:45:47 2016 +0000 +++ b/hgext/blackbox.py Thu Feb 11 19:38:26 2016 +0000 @@ -18,6 +18,8 @@ # dirty is *EXPENSIVE* (slow); # each log entry indicates `+` if the repository is dirty, like :hg:`id`. dirty = True + # record the source of log messages + logsource = True [blackbox] track = command, commandfinish, commandexception, exthook, pythonhook @@ -174,9 +176,13 @@ any(ctx.sub(s).dirty() for s in ctx.substate) )): changed = '+' + if ui.configbool('blackbox', 'logsource', False): + src = ' [%s]' % event + else: + src = '' try: - ui._bbwrite('%s %s @%s%s (%s)> %s', - date, user, rev, changed, pid, formattedmsg) + ui._bbwrite('%s %s @%s%s (%s)%s> %s', + date, user, rev, changed, pid, src, formattedmsg) except IOError as err: self.debug('warning: cannot write to blackbox.log: %s\n' % err.strerror)