Add an option to capture the output in a log file

Merged Amir MOHAMMADI requested to merge log into master

Merge request reports