builtins: self.outf.write vs trace.note

Gioele Barabucci gioele at svario.it
Fri Nov 13 21:34:21 GMT 2009


Aaron Bentley wrote:
> trace.note and self.outf.write are both appropriate, depending on
> context.  Output about the process of executing the command, e.g. "using
> saved branch location" should be written using trace.note, and where
> it's not, patches are welcome.  Output which is the primary
> functionality of a command, such as the output of "bzr diff" should be
> written using self.outf, and this should not be changed.
I documented this distinction in HACKING.txt, together with 
UIFactory.show_{message,warning}. [1]

However, looking at how the code uses trace.note and ui_factory.note, I 
cannot really grasp the difference between the two. I see trace.note as a 
vehicle for messages that are not important enough wrt the running command 
to be displayed but noteworthy enough to be saved in the log (and displayed 
on stderr) like "I'm saving this URL for later use". On the contrary, 
ui_factory.note is for messages that are part of the command itself like 
"starting upgrade from version X to Y" in "bzr upgrade". Am I right?

[1] https://code.launchpad.net/~gioele/bzr/doc-fixes/

-- 
Gioele Barabucci <gioele at svario.it>




More information about the bazaar mailing list