def METHOD_NAME(*args):
    # Log function call
    argstr = ', '.join(map(_arg_repr, args))
    logger.debug("%s(%s)" % (fn.__name__, argstr))
    # Call function
    ret = fn(*args)
    # Log return value
    if ret is not None:
        if fn.__name__ == 'glReadPixels':
            logger.debug(" <= %s[%s]" % (type(ret), len(ret)))
        else:
            logger.debug(" <= %s" % repr(ret))
    # Check for errors (raises if an error occured)
    check_error(fn.__name__)
    # Return
    return ret