Logger to not show INFO from external libaries
<p>I want logger to print INFO messages from all my code but not from 3rd party libraries. This is discussed in multiple places, but the suggested solution does not work for me. Here is my simulation of external library, <code>extlib.py</code>:</p>

<pre><code>#!/usr/bin/env python3
from logging import info

def f():
    info("i am extlib f()")
</code></pre>

<p>My module:</p>

<pre><code>#!/usr/bin/env python3
import logging
from logging import info
import extlib

logging.basicConfig(level=logging.INFO)
info("I am mymodule")
extlib.f()
</code></pre>

<p>Output:</p>

<blockquote>
  <p>INFO:root:I am mymodule </p>
  
  <p>INFO:root:i am extlib f()</p>
</blockquote>

<p>My attempt to only enable INFO for local module:</p>

<pre><code>#!/usr/bin/env python3
import logging
from logging import info
import extlib

logging.getLogger(__name__).setLevel(logging.INFO)
info("I am mymodule")
extlib.f()
</code></pre>

<p>Output: nothing</p>

<p>Desired output:</p>

<blockquote>
  <p>INFO:root:I am mymodule </p>
</blockquote>

<p>What am I doing wrong?</p>