Add a hook for constructing custom log messages