feat: add Blaze.setExceptionLogLevel() to configure exception log level#509
feat: add Blaze.setExceptionLogLevel() to configure exception log level#509nicolv wants to merge 10 commits into
Conversation
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.18.1. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.18.1) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.18.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 3.14.2. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@3.14.1...3.14.2) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 3.14.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jan Küster <jkuester@uni-bremen.de>
Blaze 3.0.3
Closes meteor#314 Template exceptions currently always use console.log, which causes two problems: 1. They don't appear in Sentry and other error trackers that only capture console.error/warn output 2. Developers can't fail-fast on template errors since there's no way to elevate them to error level This change is fully backward compatible — the default remains console.log. Users can now call Blaze.setExceptionLogLevel('error') to route exceptions to console.error, or 'warn' for console.warn. Usage: Blaze.setExceptionLogLevel('error'); // exceptions appear in error console Allowed levels: 'log', 'warn', 'error'
|
Thank you @nicolv for your contribution! Please review #495 and #481 to make sure, this is not a duplicate. If this is a duplicate then I am very sorry for not linking them in the #314 issue. Both PRs are targeting 3.1.0 which is not published yet but we are working on it. If you like to contribute to 3.1.0 then please look at the milestones at https://github.com/meteor/blaze/milestone/11 Let me know how to proceed here. |
|
Thanks for the pointers! I've reviewed both PRs:
My PR still adds value on top of #495 because it gives developers control over the log level instead of forcing |
|
I changed the base to 3.1.0 but as you pointed out @nicolv you would have to rebase. Another important requirement for merging would be - that the default behavior (using console.log) remains untouched when not explicitly changed, in order to keep this working with APM tools. Once you have rebased I am eager to review and test this one. |
What
Adds a new
Blaze.setExceptionLogLevel(level)method that lets apps configure which console method is used when Blaze reports template exceptions.Why
Fixes #314 — currently all template exceptions are reported via
console.log, which means they don't show up in error trackers that only captureconsole.error(like Sentry). There's also no way to make the app fail-fast on template errors since exceptions are always logged as info level.How
The default remains
console.logto avoid breaking existing apps (as discussed in the issue). Apps that want exceptions in the error console can now call:Allowed levels:
'log','warn','error'.The change is fully backward compatible — existing behavior is unchanged unless you opt in.
Testing
Existing tests should continue to pass. The default behavior is unchanged.