[bitbake-devel] [PATCH v2] bitbake: Colorize knotty interactive console output

Seth Bollinger seth.boll at gmail.com
Mon Nov 12 02:02:59 UTC 2012


color_enabled is initialized on line 58 of msg.py.  I did this in the same
way as other class variables are initialized.

    levelnames = {
        DEBUG3   : 'DEBUG',
        DEBUG2   : 'DEBUG',
        DEBUG   : 'DEBUG',
        VERBOSE: 'NOTE',
        NOTE    : 'NOTE',
        PLAIN  : '',
        WARNING : 'WARNING',
        ERROR   : 'ERROR',
        CRITICAL: 'ERROR',
    }

    color_enabled = False
    BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(30,38)


On Sun, Nov 11, 2012 at 4:54 PM, Chris Larson <clarson at kergoth.com> wrote:

>
>
> On Sun, Nov 11, 2012 at 8:17 AM, Seth Bollinger <seth.boll at gmail.com>wrote:
>
>> @@ -67,6 +86,8 @@ class BBLogFormatter(logging.Formatter):
>>          if record.levelno == self.PLAIN:
>>              msg = record.getMessage()
>>          else:
>> +            if self.color_enabled:
>> +                self.colorize(record)
>>
>
>
> I'm not seeing your definition of color_enabled in the constructor.
> Wouldn't this attribute not exist when it's first created, before
> enable_color() is called? Have you tested this with a non-interactive
> terminal? I'd think you'd want a self.color_enabled = False in the
> constructor for the formatter.
> --
> Christopher Larson
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20121111/ba777cfe/attachment-0001.html>


More information about the bitbake-devel mailing list