Better api for enable/disable logging