~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Erik Bågfors
  • Date: 2006-02-03 19:50:59 UTC
  • mto: (1185.50.77 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: erik@bagfors.nu-20060203195059-1cf8ff5aa68de0ea
Support for plugins to register log formatters and set default formatter
Also, change one command line option for "log"

Show diffs side-by-side

added added

removed removed

Lines of Context:
450
450
    lf = LineLogFormatter(None)
451
451
    return lf.log_string(rev, max_chars)
452
452
 
453
 
FORMATTERS = {'long': LongLogFormatter,
 
453
FORMATTERS = {'default': LongLogFormatter,
 
454
              'long': LongLogFormatter,
454
455
              'short': ShortLogFormatter,
455
456
              'line': LineLogFormatter,
456
457
              }
457
458
 
 
459
def register_formatter(name, formatter):
 
460
    FORMATTERS[name] = formatter
 
461
 
 
462
def set_default_formatter(formatter):
 
463
    FORMATTERS['default'] = formatter
 
464
 
458
465
 
459
466
def log_formatter(name, *args, **kwargs):
460
467
    """Construct a formatter from arguments.