-
Notifications
You must be signed in to change notification settings - Fork 71
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
Console log output and events feature request #53
Comments
like a |
Yeah sure, but this doesn't work at the moment, and also could be Or promise instead of callback. :) Cheers |
Seems like a good idea. Some points: 1.) I think we definitely wouldn't want a promise for this sort of thing. Sounds like you'd like to extend 2.) IIRC as @terinjokes pointed out to me the other day in person, callbacks should only be triggered for events originating from scripts whose errors are not muted for security. Edit: And furthermore, if 2.) is valid, something like |
We've defined an interface in this specification. I think there's more benefit to being able to pass an implementation of that interface (which might be this Console, or something created at runtime) to the library, rather than adding and requiring eventing supporting to all console implementations. |
would console.read() also include the script source? i.e. "some message" app.js:45 |
I agree with @terinjokes on this, and I think there's more benefit to being able to build a mechanism that can do some sort of tracking when console methods are called as opposed to build that in here. This is mostly because it is only application code that calls the console methods, so application code authors (devs) should be able to easily track when these methods are being called. It may be useful however, to be alerted when warnings are reported to the console (see #57), I guess it'd be worth polling implementers there, but I'm not sure. Regarding console.read, there might be benefit to storing and having access to previous console output, but I think I'd need a more compelling use-case than web-platform-tests/wpt#8654 (testing). As discussed a bit in #75, there is some use but most of it isn't terribly productive so for now I'm kind of against it. |
Hi,
I would like to request for a couple features, on request we should have a method that can output everything console has recorded so far like a stack list.
This is useful when you need to save it programmatically rather than debugging manually.
I would also like an event listener, so we can assign a handler and do something when there is a new entry on log, warn, error etc. Again for the same reason.
The text was updated successfully, but these errors were encountered: