[RFC] support for plugins to implement their own log formatters

Erik Bågfors zindar at gmail.com
Fri Feb 3 20:32:38 GMT 2006


Hi

I wanted to implement my own log formatter as a plugin and it looked
like it was possible in bzrlib... but it wasn't really.  So I made it
possible.

However, I'm uncertain about some details.   I did the following changes

in log.py, created "register_formatter" and "set_default_formatter"
that plugins can use to do register and change the default.  Changed
how default formatter was choosen.  This all felt like no-brainers...

I also added another command line option to select with formatter to
use.  I called it "log-format" for now.  So you can use "bzr log
--log-format short" to do the same thing as "bzr log --short". 
--short is still supported. Now a new plugin can register a formatter
"foo" and you can use "--log-format foo" to use it.

I'm not 100% happy about this command line option, but at least it
works as expected. You now have  both --long, --line, --short, and
--log-format ARG.  That's not really good.

You can find a branch at http://erik.bagfors.nu/bzr.log.plugins/

Attached is the patch for the same things as you can find in the
branch and also a small plugin that's registering it's own formatter.

Comments welcome...

Regards,
Erik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.plugins.patch
Type: text/x-patch
Size: 3258 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060203/98203f1a/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: __init__.py
Type: text/x-python
Size: 1207 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060203/98203f1a/attachment.py 


More information about the bazaar mailing list