Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug where the arguments were ignored during logger setup #95

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ var (
)

func main() {
initLogger()
initArgparser()
initLogger()
parseArguments()

logger.Infof("starting azure-devops-exporter v%s (%s; %s; by %v)", gitTag, gitCommit, runtime.Version(), Author)
logger.Info(string(opts.GetJson()))
Expand Down Expand Up @@ -70,7 +71,10 @@ func initArgparser() {
os.Exit(1)
}
}
}

// parses and validates the arguments
func parseArguments() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarCloud complains about the complexity of this method but I would prefer to not refactor this now

// load accesstoken from file
if opts.AzureDevops.AccessTokenFile != nil && len(*opts.AzureDevops.AccessTokenFile) > 0 {
logger.Infof("reading access token from file \"%s\"", *opts.AzureDevops.AccessTokenFile)
Expand Down
Loading