Added option to disable logging.