Review Request: Enable kDebug/kWarning/kError colors when sending output to file instead of tty

David Faure faure at kde.org
Fri Feb 18 16:14:40 GMT 2011



> On Feb. 18, 2011, 2:03 p.m., Sergio Luis Martins wrote:
> > Johannes Sixt wrote:
> > > Why a new variable? Wouldn't it be possible to give the value of
> > > KDE_COLOR_DEBUG a meaning? For example:
> > > KDE_COLOR_DEBUG=always
> > > could enable the new behavior, any other value (except empty) the old
> > > behavior.
> > 
> > I think that's not consistent, for one behavior you have a nice string "always", and for other you can just set it to 0, 1, 2. People might even use "never" and think it would disable colors.
> > 
> > We should use either a set/unset approach or an approach with full strings for every option: "always", "never" (default), "onlytty"
> >

Yep, but rather than "onlytty" which is not intuitive (too technical), call it "auto".

This would match exactly the options for grep --color: never, always or auto.

And make "1" an alias for "auto", for compat reasons.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100675/#review1486
-----------------------------------------------------------


On Feb. 17, 2011, 8:49 p.m., Sergio Luis Martins wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/100675/
> -----------------------------------------------------------
> 
> (Updated Feb. 17, 2011, 8:49 p.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> The existing KDE_COLOR_DEBUG env variable enables colors for output sent to a tty.
> 
> This patch introduces a new variable, KDE_COLOR_DEBUG_ANY_FD, which enables colors sent to any file descriptor, not only terminals.
> 
> Use case:
> 
> I usually start the applications which I develop with &> application.log, and I need a fast way to read the logs and find any kError( colored red ) output quickly.
> 
> 
> Diffs
> -----
> 
>   kdecore/io/kdebug.cpp 210a44c 
> 
> Diff: http://git.reviewboard.kde.org/r/100675/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergio Luis
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110218/978bf4d2/attachment.htm>


More information about the kde-core-devel mailing list