Add constants and log utils#13
Merged
heshanpadmasiri merged 6 commits intoballerina-platform:mainfrom Nov 14, 2025
Merged
Conversation
6d4b13b to
4affcc0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces new error handling and logging utilities, along with a set of constants for symbol flags. The main changes include adding stack trace support to errors, structured logging for critical failures, and a new constants package for commonly used values. Comprehensive unit tests have also been added to verify the new error handling features.
Error handling and logging enhancements:
ErrorWithStackTracetype and theDecorateWithStackTracefunction inerrors.goto support attaching stack traces to errors when theBAL_BACKTRACEenvironment variable is enabled.LogBadSadandPrintCrashLogfunctions inerrors.gofor structured logging of critical, unexpected errors, including timestamp and severity level.Constants and symbol flags:
constants.gofile with commonly used string constants and a set of symbol flag bitmasks, plus a utility functionIsFlagOnto check flag values.Testing improvements:
errors_test.gowith unit tests for stack trace decoration, error formatting, and edge cases for the new error handling utilities.Refactoring and imports:
errors.goto support new error handling and logging features.Closes #11