On 03/09/2013 22:11, Tom Wijsman wrote:
> On Tue, 3 Sep 2013 14:03:14 -0500
> William Hubbs <willi...@gentoo.org> wrote:
> 
>> On Tue, Sep 03, 2013 at 10:25:19AM +0200, Ulrich Mueller wrote:
>>>>>>>> On Tue, 3 Sep 2013, Tom Wijsman wrote:
>>>
>>>> On Mon, 2 Sep 2013 14:21:52 -0500
>>>> William Hubbs <willi...@gentoo.org> wrote:
>>>
>>>>> 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.
>>>
>>>> They belong there so future display can remain colorful.
>>>
>>>> Why do they not belong there? What do people have to do who want
>>>> them?
>>>
>>> Escape sequences have been designed for communication with
>>> peripheral devices, not for markup or as a storage format.
>>>
>>> Also "future colorful display" generally won't be portabe because
>>> escape sequences depend on the setting of the TERM variable. (And
>>> again, software that emits them with TERM=dumb or TERM unset is
>>> broken.)
>>
>> Ulrich has summed this up well here. The bottom line is that escape
>> sequences are for communicating with the user's peripheral devices.
> 
> Nice summary. But, it is also communicating with my peripheral device.
> 
>> Since yours may not be the same as the user's who created the log, you
>> don't even know that yours will respond the same way.
> 
> Sounds like something we need to standardize. Although, from the many
> build logs I have came across; it does respond fairly well in most of
> the cases, I am yet to come across a build log that displays bad.
> 
> And for that occasional build log, stripping isn't a hard thing to do.
> 
>> I don't care what goes to the user's terminal, but these escape
>> sequences do not belong in log files.
> 
> And then I asked the questions that I'd like to see answered:
> 
> Why do they not belong there? What do people have to do who want them?
> 

escape sequences in logs (any kind of logs) are basically noise, they
make search and grep hard to use. They also make the log impossible to
read properly if your terminal type is not the same as what was in
effect when the log was created. And they are essentially candy. A log
without escapes that you wish had them is still usable. A log with
escapes you wish were absent is impossible to use sanely.

The solution is obvious - default to writing plain text to log files and
give the user an option to enable escapes in the log if {s,}he chooses
to have it. This does mean you can't use tricks with tee.

I *do* like colorized text on my terminal, but I do believe we ought to
keep defaults sane - the minimum that could possibly work. Everything
extra should be optional

-- 
Alan McKinnon
alan.mckin...@gmail.com


Reply via email to