Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Interesting... I played a little in the console and it looks like the second call to <code>logging.config.fileConfig</code> is mucking things up. Not sure why this is though... Here's a transcript that shows the problem:</p> <pre><code>lorien$ python2.5 Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import logging &gt;&gt;&gt; import logging.config &gt;&gt;&gt; logging.config.fileConfig('logger.conf') &gt;&gt;&gt; alog = logging.getLogger('a.submod') &gt;&gt;&gt; alog.info('foo') foo &gt;&gt;&gt; import logging &gt;&gt;&gt; import logging.config &gt;&gt;&gt; alog.info('foo') foo &gt;&gt;&gt; logging.config.fileConfig('logger.conf') &gt;&gt;&gt; alog.info('foo') &gt;&gt;&gt; alog = logging.getLogger('a.submod') &gt;&gt;&gt; alog.info('foo') &gt;&gt;&gt; &gt;&gt;&gt; blog = logging.getLogger('b.submod') &gt;&gt;&gt; blog.info('foo') foo &gt;&gt;&gt; </code></pre> <p>As soon as I call <code>logging.config.fileConfig</code> the second time, my logger instance stops logging. Grabbing a new logging instance doesn't help since it's the same object. If I wait until after configuring both times to fetch the logger instances, then things work - this is why the <code>blog</code> instance works.</p> <p>My suggestion is to delay grabbing the logger instances until you are in the functions. If you move the calls to <code>logging.getLogger()</code> into <code>function_one</code> and <code>function_two</code>, then everything works well.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload