Simplify logging

By making log a closure inside Compile, we can reference the p (data
pointer) var from the outer scope, so we don't need to provide it in
every call.