Skip to content
Snippets Groups Projects
Commit 56132ebd authored by sliquister's avatar sliquister
Browse files

blackbox: disable extremely verbose logging (issue6110)

This is maybe not the best way to go about fixing this, but anything
is better than the status quo.

Differential Revision: https://phab.mercurial-scm.org/D6611
parent 117437f3
Branches
Tags
No related merge requests found
......@@ -9,9 +9,10 @@
"""log repository events to a blackbox for debugging
Logs event information to .hg/blackbox.log to help debug and diagnose problems.
The events that get logged can be configured via the blackbox.track config key.
The events that get logged can be configured via the blackbox.track and
blackbox.ignore config keys.
Examples::
[blackbox]
track = *
......@@ -13,8 +14,9 @@
Examples::
[blackbox]
track = *
ignore = pythonhook
# dirty is *EXPENSIVE* (slow);
# each log entry indicates `+` if the repository is dirty, like :hg:`id`.
dirty = True
......@@ -84,6 +86,9 @@
configitem('blackbox', 'track',
default=lambda: ['*'],
)
configitem('blackbox', 'ignore',
default=lambda: ['chgserver', 'cmdserver', 'extension'],
)
configitem('blackbox', 'date-format',
default='%Y/%m/%d %H:%M:%S',
)
......@@ -94,8 +99,9 @@
def __init__(self, ui, repo):
self._repo = repo
self._trackedevents = set(ui.configlist('blackbox', 'track'))
self._ignoredevents = set(ui.configlist('blackbox', 'ignore'))
self._maxfiles = ui.configint('blackbox', 'maxfiles')
self._maxsize = ui.configbytes('blackbox', 'maxsize')
self._inlog = False
def tracked(self, event):
......@@ -97,9 +103,11 @@
self._maxfiles = ui.configint('blackbox', 'maxfiles')
self._maxsize = ui.configbytes('blackbox', 'maxsize')
self._inlog = False
def tracked(self, event):
return b'*' in self._trackedevents or event in self._trackedevents
return ((b'*' in self._trackedevents
and event not in self._ignoredevents)
or event in self._trackedevents)
def log(self, ui, event, msg, opts):
# self._log() -> ctx.dirty() may create new subrepo instance, which
......
......@@ -22,9 +22,6 @@
> [alias]
> confuse = log --limit 3
> so-confusing = confuse --style compact
> [blackbox]
> track = backupbundle, branchcache, command, commandalias, commandexception,
> commandfinish, debug, exthook, incoming, pythonhook, tagscache
> EOF
$ hg init blackboxtest
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment