[MERGE] ``BZR_LOG=disable`` suppresses writing messages to .bzr.log.
John Arbash Meinel
john at arbash-meinel.com
Mon Jan 28 14:11:48 GMT 2008
Alexander Belchenko wrote:
> This patch adds support for BZR_LOG env variables that allows to
> suppress .bzr.log.
>
It seems to me that it should be done by the 'bzr' code, not inside the
bzrlib code.
Specifically, inside 'bzr' we have:
if __name__ == '__main__':
bzrlib.trace.enable_default_logging()
exit_val = bzrlib.commands.main(sys.argv)
If someone is asking 'bzrlib' to enable the log, then I think we should
be doing so.
So I would prefer something like:
if __name__ == '__main__':
if os.environ.get('BZR_LOG', '').lower() != 'disable':
bzrlib.trace.enable_default_logging()
As far as having it in a config file rather than in an environment
variable... I understand the utility of it, but by the time we get to
parsing config files, we've already started logging.
So we *could* do that, but it would be difficult to make it not log
anything.
I'm also not a big fan of calling it "BZR_LOG=disable". I might prefer
BZR_DISABLE_LOG=1
or
BZR_ENABLE_LOG=0
John
=:->
More information about the bazaar
mailing list