(maint) Rework logging for unity builds

Use a macro - so it can be redefined in a unity build - in place of a
static variable.