On 4 September 2013 08:11, Tom Wijsman <tom...@gentoo.org> wrote:

> 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?
>


If anyone needs a poster child for the sort of escape sequence outputs that
most definitely are of no value to somebody reading the log after the fact,
the output from vims' test suite is a good example.

Granted, it uses a very wide variety of terminal escape codes, which
include, but are not limited to, window resizing control characters.

I think given that context, it may be sane to restrict log control
characters to a specific subset of control characters, specifically basic
colour/highlighting control characters, which are at least somewhat
standardized and not too device specific ( not all devices support all
colour control characters, or bold/italic/underline control characters, but
the negative side effect of not supporting a given control character in
this case is minimal )

You could perhaps have an ENV var that controls the manner in which log
files are written, say:

PORTAGE_LOG_ESCAPES="all"  # no stripping of control characters
PORTAGE_LOG_ESCAPES="color" # strips all but color control characters
PORTAGE_LOG_ESCAPES="color style" # strips all but
color/bold/italic/underline/reverse/conceal control characters
PORTAGE_LOG_ESCAPES="none" # strip all control characters

Somewhere in these control modes somebody needs to define how "\r" and "\b"
are treated, simply removing those characters could conceivably make log
files worse, not better, because it would reintroduce messages/characters
that were not seen by the end user.

Perhaps something like

PORTAGE_LOG_ESCAPES="erasures:strip" # remove erasure characters
PORTAGE_LOG_ESCAPES="erasures:apply" # Apply the logical effect of
erasures, deleting characters from the output log to mimic how it would be
displayed
PORTAGE_LOG_ESCAPES="erasures:keep" # keep \r and \b

Either way, if you were to introduce such a variable, you could have a
standard defined value that Gentoo agree upon, which I'd imagine might be
"none erasures:apply"  or something like that, and end users can turn them
back on if they want, with a caveat that users should apply a standard
stripping to these logs before submitting them to bugzilla, with a tool
that comes standard with portage to facilitate stripping logs for
submission to bugzilla.

This gives users the control they want, the features they want if they need
them, and still gives gentoo staff an easier time if it is determined
escape codes are not useful for bug reports.






-- 
Kent

Reply via email to