No handlers could be found for logger "__main__"
<p>I am getting this logger error and I'm not sure how this occurred. I created much simpler test programs and they worked. Any thoughts where this error could be coming from?</p>

<p>Running this program in python 2.6!</p>

<p>error:</p>

<pre><code>No handlers could be found for logger "__main__"
</code></pre>

<p>code:</p>

<pre><code>import logging
import subprocess as sp

logger = logging.getLogger(__name__)

def runpig(filename):
    # does not use logger
    ....
    ....
    return

def main():
    try:
        runpig(filename)
    except sp.CalledProcessError as ex:
        logger.error(ex.message)
    except:
        logger.info("Error occured")

if __name__ == "__main__":
    main()
</code></pre>