Show More
@@ -9,12 +9,14 b'' | |||
|
9 | 9 | """log repository events to a blackbox for debugging |
|
10 | 10 | |
|
11 | 11 | Logs event information to .hg/blackbox.log to help debug and diagnose problems. |
|
12 |
The events that get logged can be configured via the blackbox.track |
|
|
12 | The events that get logged can be configured via the blackbox.track and | |
|
13 | blackbox.ignore config keys. | |
|
13 | 14 | |
|
14 | 15 | Examples:: |
|
15 | 16 | |
|
16 | 17 | [blackbox] |
|
17 | 18 | track = * |
|
19 | ignore = pythonhook | |
|
18 | 20 | # dirty is *EXPENSIVE* (slow); |
|
19 | 21 | # each log entry indicates `+` if the repository is dirty, like :hg:`id`. |
|
20 | 22 | dirty = True |
@@ -84,6 +86,9 b" configitem('blackbox', 'maxfiles'," | |||
|
84 | 86 | configitem('blackbox', 'track', |
|
85 | 87 | default=lambda: ['*'], |
|
86 | 88 | ) |
|
89 | configitem('blackbox', 'ignore', | |
|
90 | default=lambda: ['chgserver', 'cmdserver', 'extension'], | |
|
91 | ) | |
|
87 | 92 | configitem('blackbox', 'date-format', |
|
88 | 93 | default='%Y/%m/%d %H:%M:%S', |
|
89 | 94 | ) |
@@ -94,12 +99,15 b' class blackboxlogger(object):' | |||
|
94 | 99 | def __init__(self, ui, repo): |
|
95 | 100 | self._repo = repo |
|
96 | 101 | self._trackedevents = set(ui.configlist('blackbox', 'track')) |
|
102 | self._ignoredevents = set(ui.configlist('blackbox', 'ignore')) | |
|
97 | 103 | self._maxfiles = ui.configint('blackbox', 'maxfiles') |
|
98 | 104 | self._maxsize = ui.configbytes('blackbox', 'maxsize') |
|
99 | 105 | self._inlog = False |
|
100 | 106 | |
|
101 | 107 | def tracked(self, event): |
|
102 |
return b'*' in self._trackedevents |
|
|
108 | return ((b'*' in self._trackedevents | |
|
109 | and event not in self._ignoredevents) | |
|
110 | or event in self._trackedevents) | |
|
103 | 111 | |
|
104 | 112 | def log(self, ui, event, msg, opts): |
|
105 | 113 | # self._log() -> ctx.dirty() may create new subrepo instance, which |
@@ -22,9 +22,6 b' setup' | |||
|
22 | 22 | > [alias] |
|
23 | 23 | > confuse = log --limit 3 |
|
24 | 24 | > so-confusing = confuse --style compact |
|
25 | > [blackbox] | |
|
26 | > track = backupbundle, branchcache, command, commandalias, commandexception, | |
|
27 | > commandfinish, debug, exthook, incoming, pythonhook, tagscache | |
|
28 | 25 | > EOF |
|
29 | 26 | |
|
30 | 27 | $ hg init blackboxtest |
General Comments 0
You need to be logged in to leave comments.
Login now