All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: "bitbake-devel@lists.openembedded.org"
	<bitbake-devel@lists.openembedded.org>
Subject: Re: [PATCH v2] bitbake: Colorize knotty interactive console output
Date: Tue, 13 Nov 2012 16:36:14 -0600	[thread overview]
Message-ID: <50A2CB5E.8030600@windriver.com> (raw)
In-Reply-To: <1352820166.24487.136.camel@ted>

[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]

On 11/13/2012 09:22 AM, Richard Purdie wrote:
> On Tue, 2012-11-13 at 08:45 -0600, Seth Bollinger wrote:
>> I'm not sure how best to resolve this.  Would you like me to add some
>> code to try and detect background color?  This seems like it might be
>> more complex than it's worth...
>>
>> Or would it be better to have a selectable light background color
>> set?  If you think light background is more common (I dislike staring
>> at large blocks of white :)) it could default to the light color set.
> I have not looked into this and am not an expert on terminals and colour
> control of them. I don't know how we can solve this but the current
> situation where it prints white on white on my terminal is clearly
> unacceptable. This has to be a problem others have run into and solved
> before though...


If you are planning to colorize things, my recommendation would be to take the "middle ground" and use the transparency instead of using white which should work in general on any modern terminal.

Change the patch a bit like this:
+    color_enabled = False
+    BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(30,38)

    BASECOLOR, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(29,38)

+
+    COLORS = {
+        DEBUG3  : CYAN,
+        DEBUG2  : CYAN,
+        DEBUG   : CYAN,
+        VERBOSE : BASECOLOR,
+        NOTE    : BASECOLOR,
+        PLAIN   : BASECOLOR,
+        WARNING : YELLOW,
+        ERROR   : RED,
+        CRITICAL: RED,
+    }


Most of the time terminals are either "dark" or "light", and default color is always set to -1 in the curses interface.  For example, the attached patch will allow the patch to work on my "lawngreen" default xterms as well as more typical defaults for gnome-terminal or rxvt.

Cheers,
Jason.

[-- Attachment #2: colors.diff --]
[-- Type: application/mbox, Size: 705 bytes --]

  reply	other threads:[~2012-11-13 22:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-11 15:17 [PATCH v2] bitbake: Colorize knotty interactive console output Seth Bollinger
2012-11-11 22:54 ` Chris Larson
2012-11-12  2:02   ` Seth Bollinger
2012-11-12  2:24     ` Chris Larson
2012-11-13 14:23 ` Richard Purdie
2012-11-13 14:45   ` Seth Bollinger
2012-11-13 15:22     ` Richard Purdie
2012-11-13 22:36       ` Jason Wessel [this message]
2012-11-14 13:18         ` Seth Bollinger
2012-11-14 13:22           ` Richard Purdie
2012-11-14 14:43             ` Seth Bollinger
2012-11-14 23:26               ` Richard Purdie
     [not found]                 ` <CA+JN8xN-vkLxtd+J4BZoQ39xs3Yujh-J=CQ8q+T1k0r-t-bpzA@mail.gmail.com>
2012-11-16 14:45                   ` Seth Bollinger
2012-11-22  3:36 ` Robert Yang
2012-11-25 21:37   ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50A2CB5E.8030600@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.