Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #94941

Re: Optimal solution for coloring logging output

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 195.154.70.45
Path csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!news.redatomik.org!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'url:pypi': 0.03; 'from:addr:yahoo.co.uk': 0.05; 'that?': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subclass': 0.09; 'thread': 0.10; 'python': 0.10; 'itself.': 0.11; 'output': 0.13; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'version?': 0.16; 'wrote:': 0.16; 'hacking': 0.18; "shouldn't": 0.18; 'language': 0.19; 'preferred': 0.20; 'lawrence': 0.22; 'decide': 0.23; 'fit': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'logging': 0.27; 'that.': 0.30; "we're": 0.30; "i'd": 0.31; 'included': 0.32; 'language.': 0.32; 'url:python': 0.33; 'recommended': 0.34; "isn't": 0.35; 'should': 0.36; 'there': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'responsible': 0.37; 'received:org': 0.37; 'itself': 0.38; 'skip:p 20': 0.38; 'means': 0.39; 'enough': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'still': 0.40; 'some': 0.40; 'care': 0.60; 'avoid': 0.61; 'show': 0.62; 'real': 0.62; 'charset:windows-1252': 0.62; 'more': 0.63; 'different': 0.63; 'our': 0.64; 'differences': 0.66; 'here': 0.66; 'offer': 0.66; 'color': 0.67; 'package?': 0.84; 'plattform': 0.84; 'pythonistas,': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Optimal solution for coloring logging output
Date Mon, 3 Aug 2015 15:31:11 +0100
References <3mlD6d4jmMzFpW0@dovecot04.posteo.de>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-78-147-187-35.as13285.net
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0
In-Reply-To <3mlD6d4jmMzFpW0@dovecot04.posteo.de>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1191.1438612295.3674.python-list@python.org> (permalink)
Lines 48
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1438612295 news.xs4all.nl 2905 [2001:888:2000:d::a6]:46600
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:94941

Show key headers only | View raw


On 03/08/2015 10:13, c.buhtz@posteo.jp wrote:
> I don't want to ask how to do this because there are so many
> "solutions" about it.
> <http://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output>
>
> There are so much different and part of unpythontic solutions I can not
> decide myself. What do you (as real pythontics) think about that.
> Which of the solutions fit to concepts of Python and its logging
> package?
>
> Coloring means here not only the message itself. The (levelname) should
> be included in the coloring.
> For myself coloring the (levelname) would be enough to avoid to much
> color in the output.
>
> 1.
> The solution itself shouldn't care about plattform differences because
> there are still some packages which are able to offer
> plattform-independent console-coloring. Which would you prefere? ;)
>
> 2.
> Some solutions derive from StreamHandler or much more bad hacking the
> emit() function. I think both of them are not responsible for how the
> output should look or be presented.
>
> 3.
> How to present the output is IMO the responsibility of a Formater, isn't
> it? So I should derive from the Formater.
>
> What do you as Pythonics think of that? ;)
>

I'd go for this https://pypi.python.org/pypi/colorlog as recommended on 
a couple of answers on the stackoverflow thread you've referenced.

A slight aside, we're "Pythonistas", not "pythontics" or "Pythonics " :)

<take cover>
Should we subclass Pythonista into Pythonista2 and Pythonista3 so that 
people can show their preferred version?
</take cover>

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Optimal solution for coloring logging output Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-08-03 15:31 +0100

csiph-web