def getLogger(name=None):

    '''
    return a logger instrumented with additional 1-letter logging methods;
    '''

    logger = logging.getLogger(name=name)

    if not hasattr(logger, 'd'):
        def d(self, msg, *args, **kwargs):
            return self.log(DEBUG, msg, *args, **kwargs)
        logger.d = types.MethodType(d, logger)

    if not hasattr(logger, 'v'):
        def v(self, msg, *args, **kwargs):
            return self.log(VERBOSE, msg, *args, **kwargs)
        logger.v = types.MethodType(v, logger)

    if not hasattr(logger, 'i'):
        def i(self, msg, *args, **kwargs):
            return self.log(INFO, msg, *args, **kwargs)
        logger.i = types.MethodType(i, logger)

    if not hasattr(logger, 'w'):
        def w(self, msg, *args, **kwargs):
            return self.log(WARN, msg, *args, **kwargs)
        logger.w = types.MethodType(w, logger)

    if not hasattr(logger, 'e'):
        def e(self, msg, *args, **kwargs):
            return self.log(ERROR, msg, *args, **kwargs)
        logger.e = types.MethodType(e, logger)

    return logger
def getLogger ( name = None ) : logger = logging . getLogger ( name = name ) if not hasattr ( logger , 'd' ) : def d ( self , msg , * args , ** kwargs ) : return self . log ( DEBUG , msg , * args , ** kwargs ) logger . d = types . MethodType ( d , logger ) if not hasattr ( logger , 'v' ) : def v ( self , msg , * args , ** kwargs ) : return self . log ( VERBOSE , msg , * args , ** kwargs ) logger . v = types . MethodType ( v , logger ) if not hasattr ( logger , 'i' ) : def i ( self , msg , * args , ** kwargs ) : return self . log ( INFO , msg , * args , ** kwargs ) logger . i = types . MethodType ( i , logger ) if not hasattr ( logger , 'w' ) : def w ( self , msg , * args , ** kwargs ) : return self . log ( WARN , msg , * args , ** kwargs ) logger . w = types . MethodType ( w , logger ) if not hasattr ( logger , 'e' ) : def e ( self , msg , * args , ** kwargs ) : return self . log ( ERROR , msg , * args , ** kwargs ) logger . e = types . MethodType ( e , logger ) return logger
return a logger instrumented with additional 1-letter logging methods;