Disable logging when no output.

@benoitc Is this proper way to determine logging should be disabled?