Most of my code at this point has been designed to run on python 2.76. So the library I wrote uses the following code so that any consumers of my libraries can have debug logging coming from the library:
So in each library file I have this:
log = logging.getLogger(__name__)
log.addHandler(logging.NullHandler())
This way if a client script using my library instantiates a logger object, the library will have log output as well.
However, I now need to tweak this library so it runs on python 2.6 and it's complaining about this bit of code:
Traceback (most recent call last):
File "./LCMTool.py", line 36, in <module>
from lcm_zfssa import *
File "/devel/v2/lcm_zfssa.py", line 20, in <module>
log.addHandler(logging.NullHandler())
AttributeError: 'module' object has no attribute 'NullHandler'
Is there a way to tweak this so that this will work with python 2.6?
Thx for any help.