From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.jumo.net ([193.24.15.13]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eoPkO-0004ez-Dn for barebox@lists.infradead.org; Wed, 21 Feb 2018 08:27:30 +0000 Received: from dentln03.jumo.net ([10.10.0.23]:3680) by mail.jumo.net with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1eoPk7-0003At-1d for barebox@lists.infradead.org; Wed, 21 Feb 2018 09:27:11 +0100 MIME-Version: 1.0 From: Eugen Wiens Date: Wed, 21 Feb 2018 09:26:38 +0100 Message-Id: <20180221082638.30664-1-eugen.wiens@jumo.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] console: added colored print out of log levels To: barebox@lists.infradead.org Cc: Eugen Wiens V2hlbiB0aGUgc3lzdGVtIGlzIGJvb3RpbmcgdGhlIHdhcm5pbmdzIGFuZCBlcnJvcnMgYXJlIG5v dCBiZSBxdWlja2x5IGRpc2NvdmVyZWQuIFdpdGggdGhpcyBpbXByb3ZlbWVudCB0aGUgZXJyb3Jz IGFyZSBjb2xvcmVkIHJlZCwgdGhlIHdhcm5pbmdzIHllbGxvdyBhbmQgdGhlIG5vdGljZXMgYmx1 ZS4NCg0KU2lnbmVkLW9mZi1ieTogRXVnZW4gV2llbnMgPGV1Z2VuLndpZW5zQGp1bW8ubmV0Pg0K LS0tDQogY29tbW9uL2NvbnNvbGVfY29tbW9uLmMgfCAyNSArKysrKysrKysrKysrKysrKysrKysr KysrDQogMSBmaWxlIGNoYW5nZWQsIDI1IGluc2VydGlvbnMoKykNCg0KZGlmZiAtLWdpdCBhL2Nv bW1vbi9jb25zb2xlX2NvbW1vbi5jIGIvY29tbW9uL2NvbnNvbGVfY29tbW9uLmM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