Higher order function that takes a map of names to object and will log their state ahead of function invocation along with the result of the function invocation