Skip to content

refactor(laas): convert schema generator logging to structured zap logger#176

Closed
Joshna907 wants to merge 1 commit intofossology:mainfrom
Joshna907:gen-external-ref-zap-logging
Closed

refactor(laas): convert schema generator logging to structured zap logger#176
Joshna907 wants to merge 1 commit intofossology:mainfrom
Joshna907:gen-external-ref-zap-logging

Conversation

@Joshna907
Copy link
Copy Markdown
Contributor

This change refactors logging in cmd/laas/gen_external_ref_schema.go by replacing standard log calls with structured Zap logging for error handling and fatal exits.

@Joshna907 Joshna907 force-pushed the gen-external-ref-zap-logging branch 2 times, most recently from 3c66177 to a5284fa Compare December 17, 2025 02:18
}
if err != nil {
log.Fatalf("Failed to instantiate json schema for external ref in license: %v", err)
logger.LogError("Failed to instantiate json schema for external ref in license", zap.Error(err))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LogFatal would be better here as the script should not run any further if there is an error in parsing a field

Copy link
Copy Markdown
Contributor

@ChayanDass ChayanDass left a comment

Choose a reason for hiding this comment

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

Please ping the maintainers after it's ready for review!

Comment on lines -44 to 45
log.Fatalf("Failed to instantiate json schema for external ref in license: %v", err)
logger.LogFatal("Failed to read external_ref_fields.yaml", zap.Error(err))
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Keep the fatal messages as they are!

@Joshna907 Joshna907 force-pushed the gen-external-ref-zap-logging branch 8 times, most recently from 2e1d78d to d0ed12c Compare January 17, 2026 03:50
@Joshna907
Copy link
Copy Markdown
Contributor Author

Joshna907 commented Jan 17, 2026

Please ping the maintainers after it's ready for review!

@deo002 , @Kaushl2208 Can we merge this pull request? it's done, Thank you

@Kaushl2208
Copy link
Copy Markdown
Member

Changes included in #193
Hence closing

@Kaushl2208 Kaushl2208 closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants