feat: Adds a NewWithFile constructor function for specifying log file output

When working through the gitlab-shell migration, I identified the need to write log messages to a log file. The code to do this can be a little clunky, and it's easy to mess up the combination of flags required to be successful in all cases.

This commit adds a new NewWithFile constructor function that can be used inline to get the os.File from filePath specified. If the file cannot be opened for any reason, it will revert to logging to Stderr.

Edited by Elliot Forbes

Merge request reports

Loading