Changeset 156

Show
Ignore:
Timestamp:
02/05/10 09:10:51 (2 years ago)
Author:
phil
Message:

mute the "No Handler Found" warning for programs that don't use logging

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • rdfalchemy/trunk/rdfalchemy/__init__.py

    r152 r156  
    77from engine import create_engine, engine_from_config 
    88 
     9# if users don't use logging they could see a  
     10# a confusing "No Handler could be found" warning 
     11# this will mute that warning 
     12import logging 
     13 
     14class NullHandler(logging.Handler): 
     15    def emit(self, record): 
     16        pass 
     17 
     18log = logging.getLogger(__name__) 
     19log.addHandler(NullHandler()) 
     20 
    921__version__="0.2b2"