Fix missing logging context in a series of dprintf()s. Partially based on