adding function argument to write log outputs to file