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


Groups > comp.lang.python > #12435

Re: Help me understand this logging config

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <anand.ibmgsi@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.025
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'else:': 0.03; '"""': 0.07; 'finally:': 0.09; 'hierarchical': 0.09; 'def': 0.15; 'logger.': 0.16; 'name),': 0.16; 'name):': 0.16; 'placeholder': 0.16; 'skip:\xc2 30': 0.16; 'subject:logging': 0.16; 'received:74.125.82.44': 0.17; 'received:mail-ww0-f44.google.com': 0.17; 'subject:Help': 0.17; 'pointed': 0.21; 'url:home': 0.21; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'creating': 0.25; 'code.': 0.26; 'lee': 0.28; 'message-id:@mail.gmail.com': 0.29; 'fix': 0.29; 'anand': 0.30; 'exist.': 0.30; 'skip:\xc2 20': 0.30; 'specified': 0.31; "didn't": 0.31; 'references': 0.32; 'hi,': 0.32; 'yet': 0.32; 'source': 0.33; 'to:addr:python-list': 0.33; 'creates': 0.34; 'skip:& 10': 0.34; 'all.': 0.34; 'try:': 0.34; 'created': 0.36; 'none': 0.37; 'checks': 0.37; 'but': 0.37; 'received:74.125.82': 0.38; 'received:google.com': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'received:74.125': 0.39; 'love': 0.62; 'took': 0.63; 'lives': 0.63; 'truth': 0.64; 'man': 0.65; '8bit%:88': 0.66; '\xc2\xa0\xc2\xa0': 0.67; '8bit%:100': 0.70; 'skip:\xc2 10': 0.74; 'subject:this': 0.74; 'existed': 0.91; 'url:site': 0.95
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=18vyphiBT1JxVCrWPXLTfpM8jWQP+8gK3/im1ZRdZ3Y=; b=kAmMuFtALIkRYABi5BPOLbbWhDhEPa2fwxjz6p7YU+CTE3rl6loSllIBZUbI/OkJB1 Bzj405UtVzcmyc0jiT4LbvWHBK0/qhIKyWmxDEahyJA46YNexkV4T1eucqbByudb+nXX 98TM606/rGMp7bOOi9fwcVAkY9MD55EaJr2YE=
MIME-Version 1.0
In-Reply-To <bdf729a3-5f68-46fb-b6ae-27dceed5af77@18g2000yqu.googlegroups.com>
References <bdf729a3-5f68-46fb-b6ae-27dceed5af77@18g2000yqu.googlegroups.com>
From anand jeyahar <anand.ibmgsi@gmail.com>
Date Tue, 30 Aug 2011 17:01:42 +0530
Subject Re: Help me understand this logging config
To python-list@python.org
Content-Type multipart/alternative; boundary=00248c0ef1a64e51c004abb75c64
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.567.1314703930.27778.python-list@python.org> (permalink)
Lines 112
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1314703930 news.xs4all.nl 2428 [2001:888:2000:d::a6]:38070
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:12435

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,
   I took a look at the logging source code. getLogger checks for existing
loggers with the given name and if it doesn't creates one.



def getLogger(self, name):
        """
        Get a logger with the specified name (channel name), creating it
        if it doesn't yet exist. This name is a dot-separated hierarchical
        name, such as "a", "a.b", "a.b.c" or similar.

        If a PlaceHolder existed for the specified name [i.e. the logger
        didn't exist but a child of it did], replace it with the created
        logger and fix up the parent/child references which pointed to the
        placeholder to now point to the logger.
        """
        rv = None
        _acquireLock()
        try:
            if name in self.loggerDict:
                rv = self.loggerDict[name]
                if isinstance(rv, PlaceHolder):
                    ph = rv
                    rv = (self.loggerClass or _loggerClass)(name)
                    rv.manager = self
                    self.loggerDict[name] = rv
                    self._fixupChildren(ph, rv)
                    self._fixupParents(rv)
            else:
                rv = (self.loggerClass or _loggerClass)(name)
                rv.manager = self
                self.loggerDict[name] = rv
                self._fixupParents(rv)
        finally:
            _releaseLock()
        return rv

==============================================
Anand Jeyahar
https://sites.google.com/site/<https://sites.google.com/site/aangjie/home/quotes>
anandjeyahar
==============================================
The man who is really serious,
with the urge to find out what truth is,
has no style at all. He lives only in what is.
                  ~Bruce Lee

Love is a trade with lousy accounting policies.
                 ~Aang Jie<https://sites.google.com/site/aangjie/home/quotes>

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


Thread

Help me understand this logging config Roy Smith <roy@panix.com> - 2011-08-29 10:53 -0700
  Re: Help me understand this logging config Peter Otten <__peter__@web.de> - 2011-08-30 11:24 +0200
    Re: Help me understand this logging config Roy Smith <roy@panix.com> - 2011-08-30 08:39 -0400
      Re: Help me understand this logging config Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2011-09-02 02:56 -0700
      Re: Help me understand this logging config Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2011-09-02 09:58 +0000
      Re: Help me understand this logging config Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2011-09-02 03:00 -0700
  Re: Help me understand this logging config anand jeyahar <anand.ibmgsi@gmail.com> - 2011-08-30 17:01 +0530

csiph-web