refactor all log messages to use same format, overhaul logExtension #190
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.
motivation:
a more structured approach to logging in order to facilitate sending logs to third party services.
structuring the logs with a message string and an optional context object turned out to be the most flexible approach while not forcing us to rewrite all messages.
some logging implementations that utilize a similar structure:
I opted to go for the ordering of arguments
(msg: string, context?: object)
instead of(context?: object, msg: string)
, but not sure anymore if it's the right bet, as the implementations mentioned above seem to switch things around.