comparison mercurial/ui.py @ 11984:2db0fccc8143

ui: add logging hook
author Matt Mackall <mpm@selenic.com>
date Thu, 19 Aug 2010 11:14:02 -0500
parents fca15617721c
children a88a4720c2f0
comparison
equal deleted inserted replaced
11983:27649cf258e3 11984:2db0fccc8143
591 self.debug('%s:%s %s/%s%s (%4.2f%%)\n' 591 self.debug('%s:%s %s/%s%s (%4.2f%%)\n'
592 % (topic, item, pos, total, unit, pct)) 592 % (topic, item, pos, total, unit, pct))
593 else: 593 else:
594 self.debug('%s:%s %s%s\n' % (topic, item, pos, unit)) 594 self.debug('%s:%s %s%s\n' % (topic, item, pos, unit))
595 595
596 def log(self, service, message):
597 '''hook for logging facility extensions
598
599 service should be a readily-identifiable subsystem, which will
600 allow filtering.
601 message should be a newline-terminated string to log.
602 '''
603 pass
604
596 def label(self, msg, label): 605 def label(self, msg, label):
597 '''style msg based on supplied label 606 '''style msg based on supplied label
598 607
599 Like ui.write(), this just returns msg unchanged, but extensions 608 Like ui.write(), this just returns msg unchanged, but extensions
600 and GUI tools can override it to allow styling output without 609 and GUI tools can override it to allow styling output without