azure-devops-exporter icon indicating copy to clipboard operation
azure-devops-exporter copied to clipboard

Arguments are getting ignored during logger setup

Open moredatapls opened this issue 1 year ago • 0 comments

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:

  1. Initialize the command line parser
  2. Initialize the logger
  3. Validate the options

I will create a pull request for this.

moredatapls avatar Jun 05 '24 06:06 moredatapls