Putting logging behind a debug flag