-
Notifications
You must be signed in to change notification settings - Fork 198
fix: prevent infinite loop on logging #370
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #370 +/- ##
===========================================
- Coverage 61.08% 30.86% -30.23%
===========================================
Files 13 43 +30
Lines 1380 1740 +360
Branches 58 100 +42
===========================================
- Hits 843 537 -306
- Misses 537 1176 +639
- Partials 0 27 +27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Nice solution however as discussed in #298 it is an issue with Browser reporter without |
It can be reproduced in node, see #298 (comment) And it's caused by this Lines 425 to 430 in 5ac9ed7
|
Wondering if we could make it safer (and faster) by using ohash for comparing log objects instead of full serialization. |
No, I've tried ( Anythings that works like It's not just the For example: const p = new Proxy({}, {
get(target, prop, receiver) {
console.warn('proxy getter', p)
return Reflect.get(target, prop, receiver)
}
})
consola.wrapConsole();
consola.warn(p);
consola.restoreConsole(); This would also result in infinite loop. (And there could be more edge cases 🫠) |
resolves #298