On 09/02/2013 01:29 PM, William Hubbs wrote: > On Mon, Sep 02, 2013 at 09:41:28PM +0200, Michał Górny wrote: >> Dnia 2013-09-02, o godz. 14:21:52 >> William Hubbs <willi...@gentoo.org> napisał(a): >> >>> On Mon, Sep 02, 2013 at 01:33:19PM +0200, Michał Górny wrote: >>>> Dnia 2013-09-01, o godz. 16:49:34 >>>> William Hubbs <willi...@gentoo.org> napisał(a): >>>> >>>>> On Sat, Aug 31, 2013 at 10:48:32PM +0200, Michał Górny wrote: >>>>>> Dnia 2013-08-31, o godz. 11:26:30 >>>>>> Ulrich Mueller <u...@gentoo.org> napisał(a): >>>>>> >>>>>>>>>>>> On Sat, 31 Aug 2013, Michał Górny wrote: >>>>>>> >>>>>>>> And time for a small update. >>>>>>> >>>>>>> In git-r3_checkout: >>>>>>> >>>>>>> git --no-pager diff --color --stat \ >>>>>>> ${old_commit_id}..${new_commit_id} >>>>>>> >>>>>>> I'd rather omit the --color option, otherwise log files will contain >>>>>>> escape sequences. >>>>>> >>>>>> I'd rather leave it. The diff is more for pretty-printing anyway, it >>>>>> shouldn't really matter in the logs. >>>>> >>>>> Please don't. I also do not want escape sequences in log files. >>>> >>>> Ok, '--color' removed. However, I think we should work something out to >>>> get both parties satisfied. Maybe portage feature or a tool to 'uncruft' >>>> logs from escape sequences since many people actually benefit from them. >>> >>> All, >>> >>> I'm starting a new thread on this, because I think it might warrant some >>> discussion. >>> >>> I can see why someone might want to use escape codes for color displays, >>> etc. However, imo, escape codes do not belong in log files. >> >> Well, colors are not the only thing that uses escape sequences. They >> are used pretty often for various kinds of progress reporting -- >> percentages, progress bars. Many tools simply don't implement any other >> kind of progress reporting, so sometimes it's either escape sequences >> or long waiting with no signs of life. >> >>> mgorny says many people benefit from having escape codes in log >>> files, but I see no benefit from it, and I don't like going through >>> build.log because of them. If you load a build.log into an editor, the >>> escape sequences are basically trash characters that get in the way. >> >> I said people benefit from having them output during the build process. >> Logs are a different thing, that's why I suggested having a feature >> that would remove those from output when generating logs. > > There is a NOCOLOR variable you can set in make.conf, but that would > require users to set it, and it also affects the display. > > How does portage write build.log?
It uses its PipeLogger class to read the output from a pipe, and write to the log (and stdout if appropriate): http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=blob_plain;f=pym/portage/util/_async/PipeLogger.py;hb=HEAD So yes, it would be possible to do translations on-the-fly. However, the event loop that handles the logging is currently single threaded, and might become a bottleneck if it has to do lots of output processing (especially for larger values of --jobs). -- Thanks, Zac