Refactor the handling of default output and threshold to `with_logging`

This logic was sprinkled through several functions in two separate
files, but for simplicity and obviousness to the end-user, it is now
at the top-level entry function, `with_logging`.