Added option to enable/disable logging.
Merge branch 'issue/optional-logging'