Added option to log to stdout