def profile(logger):
    def logger_profile(callable):
        def wrapper(*args, **kwds):
            start = time.time()
            result = callable(*args, **kwds)
            end = time.time()
            args = map(str, args)
            args += ["%s = %s" % (name, str(value)) for (name, value) in kwds.iteritems()]
            # should probably use debug, but then debug is not always enabled
            logger.info("PROFILED %s (%s): %.02f s" % (callable.__name__, ", ".join(args), end - start))
            return result
        return wrapper
    return logger_profile
Retrieve orderable products on a scene-by-scene basis.
dataset/ETHPy150Open fp7-ofelia/ocf/ofam/src/src/ext/sfa/util/sfalogging.py/profile--crossover with--dataset/ETHPy150Open mapbox/usgs/usgs/soap.py/get_order_products