Fix logging macros

macros should be fully wrapped in do { ... } while(false) to prevent
any accidental coding issues (like else being eaten!!!)