comparison mercurial/ui.py @ 18669:18242716a014

blackbox: adds a blackbox extension Adds a blackbox extension that listens to ui.log() and writes the messages to .hg/blackbox.log. Future commits will use ui.log() to log commands, unhandled exceptions, incoming changes, and hooks. The extension defaults to logging everything, but can be configured via blackbox.track to only log certain events. Log lines are of the format: "date time user> message" Example log line: 2013/02/09 08:35:19 durham> 1 incoming changes - new heads: d84ced58aaa
author Durham Goode <durham@fb.com>
date Tue, 12 Feb 2013 14:08:33 -0800
parents b35e3364f94a
children 0062508b1900
comparison
equal deleted inserted replaced
18668:4034b8d551b1 18669:18242716a014
737 self.debug('%s:%s %s/%s%s (%4.2f%%)\n' 737 self.debug('%s:%s %s/%s%s (%4.2f%%)\n'
738 % (topic, item, pos, total, unit, pct)) 738 % (topic, item, pos, total, unit, pct))
739 else: 739 else:
740 self.debug('%s:%s %s%s\n' % (topic, item, pos, unit)) 740 self.debug('%s:%s %s%s\n' % (topic, item, pos, unit))
741 741
742 def log(self, service, message): 742 def log(self, service, *msg, **opts):
743 '''hook for logging facility extensions 743 '''hook for logging facility extensions
744 744
745 service should be a readily-identifiable subsystem, which will 745 service should be a readily-identifiable subsystem, which will
746 allow filtering. 746 allow filtering.
747 message should be a newline-terminated string to log. 747 message should be a newline-terminated string to log.