refactors log() func to always call `canLog()` only once