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


Groups > comp.lang.python > #57736

Re: Logging to file and not to console

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'subject:file': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'try:': 0.09; 'warn': 0.09; 'def': 0.12; 'alert': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'subject:Logging': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'error': 0.23; 'header:X-Complaints-To:1': 0.27; 'fixing': 0.31; 'info': 0.35; 'except': 0.35; 'list': 0.37; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'name': 0.63; 'otten': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Peter Otten <__peter__@web.de>
Subject Re: Logging to file and not to console
Date Sun, 27 Oct 2013 12:18:28 +0100
Organization None
References <20131027020458.2a314eb9@hanez.org> <l4ion1$tgf$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Gmane-NNTP-Posting-Host p5084951d.dip0.t-ipconnect.de
User-Agent KNode/4.7.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.1645.1382872697.18130.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1382872697 news.xs4all.nl 15881 [2001:888:2000:d::a6]:44802
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:57736

Show key headers only | View raw


Peter Otten wrote:

> def levelnames():
>     try:
>         names = logging._nameToLevel
>     except AttributeError:
>         names = (name for name in logging._levelNames if isinstance(name,
> str))

Trainwreck alert :(

I recommend that you use the following list

"DEBUG INFO WARN ERROR CRITICAL".split()

directly rather than fixing the above.

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


Thread

Re: Logging to file and not to console Peter Otten <__peter__@web.de> - 2013-10-27 12:18 +0100

csiph-web