Mergifyio / daiquiri

Python library to easily setup basic logging functionality
Apache License 2.0
333 stars 25 forks source link

getLogger returning something that is not a logger? #25

Closed larsks closed 7 years ago

larsks commented 7 years ago

I have the following code:

SH_LOG = daiquiri.getLogger('sh')
SH_LOG.setLevel('WARNING')

This results in a traceback:

Traceback (most recent call last):
  File "/home/lars/env/common/bin/interesting", line 6, in <module>
    from interesting.main import main
  File "/home/lars/projects/interesting/interesting/main.py", line 24, in <module>
    SH_LOG = daiquiri.getLogger('sh')
AttributeError: 'KeywordArgumentAdapter' object has no attribute 'setLevel'

If I replace daiquiri with logging everything works fine.

Running Python 2.7.13.

jd commented 7 years ago

Yeah this is a Python 2 problem only, it's fixed with https://github.com/jd/daiquiri/commit/dc09d57013ac2bd9b96c5727c55aa0b48a258374

I've released 1.3.0 with that commit.