Show More
@@ -160,7 +160,6 b' class blackboxlogger(object):' | |||
|
160 | 160 | date = dateutil.datestr(default, ui.config('blackbox', 'date-format')) |
|
161 | 161 | user = procutil.getuser() |
|
162 | 162 | pid = '%d' % procutil.getpid() |
|
163 | formattedmsg = msg[0] % msg[1:] | |
|
164 | 163 | rev = '(unknown)' |
|
165 | 164 | changed = '' |
|
166 | 165 | ctx = self._repo[None] |
@@ -175,7 +174,7 b' class blackboxlogger(object):' | |||
|
175 | 174 | src = '' |
|
176 | 175 | try: |
|
177 | 176 | fmt = '%s %s @%s%s (%s)%s> %s' |
|
178 |
args = (date, user, rev, changed, pid, src, |
|
|
177 | args = (date, user, rev, changed, pid, src, msg) | |
|
179 | 178 | with _openlogfile(ui, self._bbvfs) as fp: |
|
180 | 179 | fp.write(fmt % args) |
|
181 | 180 | except (IOError, OSError) as err: |
@@ -66,7 +66,7 b' class processlogger(object):' | |||
|
66 | 66 | env = { |
|
67 | 67 | b'EVENT': event, |
|
68 | 68 | b'HGPID': os.getpid(), |
|
69 |
b'MSG1': msg |
|
|
69 | b'MSG1': msg, | |
|
70 | 70 | } |
|
71 | 71 | # keyword arguments get prefixed with OPT_ and uppercased |
|
72 | 72 | env.update((b'OPT_%s' % key.upper(), value) |
@@ -1724,14 +1724,14 b' class ui(object):' | |||
|
1724 | 1724 | """ |
|
1725 | 1725 | self._loggers[name] = logger |
|
1726 | 1726 | |
|
1727 | def log(self, event, *msg, **opts): | |
|
1727 | def log(self, event, msgfmt, *msgargs, **opts): | |
|
1728 | 1728 | '''hook for logging facility extensions |
|
1729 | 1729 | |
|
1730 | 1730 | event should be a readily-identifiable subsystem, which will |
|
1731 | 1731 | allow filtering. |
|
1732 | 1732 | |
|
1733 |
|
|
|
1734 | then any values to %-format into that format string. | |
|
1733 | msgfmt should be a newline-terminated format string to log, and | |
|
1734 | *msgargs are %-formatted into it. | |
|
1735 | 1735 | |
|
1736 | 1736 | **opts currently has no defined meanings. |
|
1737 | 1737 | ''' |
@@ -1741,6 +1741,7 b' class ui(object):' | |||
|
1741 | 1741 | if l.tracked(event)] |
|
1742 | 1742 | if not activeloggers: |
|
1743 | 1743 | return |
|
1744 | msg = msgfmt % msgargs | |
|
1744 | 1745 | # guard against recursion from e.g. ui.debug() |
|
1745 | 1746 | registeredloggers = self._loggers |
|
1746 | 1747 | self._loggers = {} |
General Comments 0
You need to be logged in to leave comments.
Login now