def add_null_handler_to_root_logger():
 log = logging.getLogger()
 if (NULL_HANDLER not in log.handlers):
  log.addHandler(NULL_HANDLER)

def add_null_handler_to_root_logger ( ) : log = logging . getLogger ( ) if ( NULL_HANDLER not in log . handlers ) : log . addHandler ( NULL_HANDLER )
add a nullhandler to the root logger .