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


Groups > comp.lang.python > #94941 > unrolled thread

Re: Optimal solution for coloring logging output

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2015-08-03 15:31 +0100
Last post2015-08-03 15:31 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#94941 — Re: Optimal solution for coloring logging output

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-08-03 15:31 +0100
SubjectRe: Optimal solution for coloring logging output
Message-ID<mailman.1191.1438612295.3674.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web