azure-devops-exporter
azure-devops-exporter copied to clipboard
Arguments are getting ignored during logger setup
The logger-related arguments are getting ignored during the logger setup, since the logger setup happens before the command line arguments are parsed, see: https://github.com/webdevops/azure-devops-exporter/blob/881f0f7a80f26d714459e2bc518ff7fca2249372/main.go#L39-L40
This is a regression caused by my own pull request, see the changes here (sorry about that).
However, the argument parser also depends on the logger, causing it to crash with a nil reference exception in case the arguments are invalid. Therefore, initArgparser should probably split up, so that the correct order of initialization would be:
- Initialize the command line parser
- Initialize the logger
- Validate the options
I will create a pull request for this.