Mercurial > hg
changeset 40994:ab92e2111408
ui: install logger that sends debug.extensions messages to stderr
This will replace the custom log function introduced at d58958676b3c
"extensions: add detailed loading information."
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 15 Dec 2018 16:24:08 +0900 |
parents | 49d48489a16b |
children | 19178aeb9b43 |
files | mercurial/ui.py |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/ui.py Sat Dec 15 19:05:42 2018 +0900 +++ b/mercurial/ui.py Sat Dec 15 16:24:08 2018 +0900 @@ -30,6 +30,7 @@ encoding, error, formatter, + loggingutil, progress, pycompat, rcutil, @@ -490,6 +491,14 @@ self._trustusers.update(self.configlist('trusted', 'users')) self._trustgroups.update(self.configlist('trusted', 'groups')) + if section in (None, b'devel', b'ui') and self.debugflag: + tracked = set() + if self.configbool(b'devel', b'debug.extensions'): + tracked.add(b'extension') + if tracked: + logger = loggingutil.fileobjectlogger(self._ferr, tracked) + self.setlogger(b'debug', logger) + def backupconfig(self, section, item): return (self._ocfg.backup(section, item), self._tcfg.backup(section, item),