-
-
Notifications
You must be signed in to change notification settings - Fork 147
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(kernel): stack preserving error logging for console #1884
Conversation
β¦c/error-logging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @Sayan751 . I dont think we need to change the message
property name. Though if you insist we can discuss more on that
package.json
Outdated
@@ -113,7 +113,7 @@ | |||
"@typescript-eslint/eslint-plugin": "6.10.0", | |||
"@typescript-eslint/parser": "6.10.0", | |||
"chalk": "4.1.2", | |||
"chromedriver": "119.0.0", | |||
"chromedriver": "121.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
packages/kernel/src/logger.ts
Outdated
@@ -226,8 +226,13 @@ export const format = toLookup({ | |||
|
|||
export interface ILogEvent { | |||
readonly severity: LogLevel; | |||
readonly messageOrError: string | Error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should still be named message
I think. It can be a plain (string) or packed (Error) message
Thanks @bigopon! |
2.0.0-beta.10 (2024-01-26) **BREAKING CHANGE:** * **enums:** string literal types replace const enums (#1870) ([e21e0c9](e21e0c9)) **Features:** * **route-recognizer:** support for route parameter constraints (#1862) ([8f29cfd](8f29cfd)) **Bug Fixes:** * **docs:** various doc fix * **au-slot:** properly handle nested projection registration (#1881) ([00e8dee](00e8dee)) * **kernel:** stack preserving error logging for console (#1884) ([030bfa1](030bfa1)) * **portal:** remove target marker when deactivated (#1883) ([3db4c17](3db4c17)) * **validation:** evaluation of tagged rules from bindings (#1878) ([43d12f6](43d12f6)) * **validation:** property parsing with lambda and istanbul (#1877) ([71f82cf](71f82cf)) * **router:** store root/default page instruction correctly (#1869) ([84e6380](84e6380)) * **runtime-html:** template wrapping (#1875) ([bfdaa3b](bfdaa3b)) * **i18n:** handle change of key in t.bind (#1868) ([c185764](c185764)) * **router-lite:** Router injection and ignoring null/undefined values for query parameters (#1859) ([6a79bc9](6a79bc9)) * **router-lite:** injection of Router alias ([6a79bc9](6a79bc9)) * **runtime-html:** fix broken tests ([bfdaa3b](bfdaa3b))
Pull Request
π Description
As of now, the console log for the following code produced incorrect/obfuscated stack information.
It produced the following stack information:
Friendlier would be something like below (result of directly logging the error using
console.error
).Reproduction: https://stackblitz.com/edit/logging-and-stacktrace?file=src%2Fmy-app.ts,src%2Fmain.ts
This PR fixes this issue.
π« Issues
π©βπ» Reviewer Notes
π Test Plan
β Next Steps