Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #68390
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.009 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; '16,': 0.03; 'handler': 0.05; 'one?': 0.05; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:Clearing': 0.16; 'wrote:': 0.18; 'import': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'logging': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; '>>>>': 0.31; 'assert': 0.31; 'received:google.com': 0.35; 'subject:?': 0.36; 'pm,': 0.38; 'mar': 0.68; 'otten': 0.84; 'to:none': 0.92 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=n9ku77nUHcQhfx7cxx+e/HM0zhN/7mevp453kEbF1zY=; b=iqbbGCh4CXSmu2MVgeszm55nPs9YrOLXdNCirgSrHPcdA/ft610v2obWw4sEUmqbdi HC1nleLiTGgXIXFoHBjzzNszs/3xdpiUw0NsX7Qif2vRcALgsrW2NS44FeSJORv+hkvs w0VatgPgKq5/oyXYXIh+k93+ILcp/V/vzdy0OnqQYZClgXaxvwYycgtdYv51FLA89Kks qgIReDN9eqZp2RcDvoCyIhVA7+i8k8T6t2JIIb6TKi/G3IHTCKWrVrseC2r0OJcLKxXO hgFE3MYK31EtS4se5eonfsj7CDoPBiwJly+j9QPDSKShwggAYQKrjS45p15KlTS5oE57 CTTA== |
| MIME-Version | 1.0 |
| X-Received | by 10.66.146.229 with SMTP id tf5mr19646661pab.50.1394962519329; Sun, 16 Mar 2014 02:35:19 -0700 (PDT) |
| In-Reply-To | <lg3q8a$2p7$1@ger.gmane.org> |
| References | <mailman.8159.1394938715.18130.python-list@python.org> <gd.usenet-B1805D.09394016032014@dwarf.main.lan> <lg3q8a$2p7$1@ger.gmane.org> |
| Date | Sun, 16 Mar 2014 20:35:19 +1100 |
| Subject | Re: Clearing out handlers in logging? |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| 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.8165.1394962522.18130.python-list@python.org> (permalink) |
| Lines | 21 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1394962522 news.xs4all.nl 2978 [2001:888:2000:d::a6]:44281 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:68390 |
Show key headers only | View raw
On Sun, Mar 16, 2014 at 8:18 PM, Peter Otten <__peter__@web.de> wrote:
> Hm, what do the docs say about this one?
>
>>>> import logging
>>>> logging.basicConfig()
>>>> log = logging.getLogger("foo")
>>>> for i in range(5):
> ... log.addHandler(logging.FileHandler("tmp.log"))
> ...
>>>> assert len(log.handlers) == 5
>>>> for handler in log.handlers:
> ... log.removeHandler(handler)
> ...
>>>> log.handlers
> [<logging.FileHandler object at 0x7f8217686e90>, <logging.FileHandler object
> at 0x7f8216f9eb90>]
for handler in log.handlers[:]:
log.removeHandler(handler)
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Clearing out handlers in logging? Tim Chase <python.list@tim.thechases.com> - 2014-03-15 21:58 -0500
Re: Clearing out handlers in logging? Gunther Dietrich <gd.usenet@spamfence.net> - 2014-03-16 09:39 +0100
Re: Clearing out handlers in logging? Chris Angelico <rosuav@gmail.com> - 2014-03-16 20:02 +1100
Re: Clearing out handlers in logging? Peter Otten <__peter__@web.de> - 2014-03-16 10:18 +0100
Re: Clearing out handlers in logging? Chris Angelico <rosuav@gmail.com> - 2014-03-16 20:35 +1100
Re: Clearing out handlers in logging? Tim Chase <python.list@tim.thechases.com> - 2014-03-16 07:57 -0500
Re: Clearing out handlers in logging? Gunther Dietrich <gd.usenet@spamfence.net> - 2014-03-16 19:29 +0100
Re: Clearing out handlers in logging? Tim Chase <python.list@tim.thechases.com> - 2014-03-16 13:50 -0500
csiph-web