added an option to disable logging