Future-proofed logging against all 8.x branches

Don't commit this without testing locally. See issue #67.