Added logging option to en-/disable logging to stdout.