-
Notifications
You must be signed in to change notification settings - Fork 293
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
[feature request] console output #52
Comments
I'd definitely like this |
Indeed, I think this falls under the "general error logging is awkward" problem mentioned in the readme. I wonder if console.log() should output to stdout (rather than stderr)? We should clearly remove the KJ boilerplate, but should we have some other prefix? E.g. What kind of stringification heuristic do we want here, for the values passed to |
I have an idea but I don't think you'll like it. :-) ... We could adopt Node.js' inspect logic to output rich console output. It's rather complicated but proven to be useful, particularly for development/debugging purposes. I'm not convinced we should have any prefix on the output but as long as it's simple it should be ok? |
If that's easy to do it seems reasonable to me. |
It depends on your definition of easy. Will have to explore it a bit. |
For some context, Node.js' inspect logic is here.. https://github.com/nodejs/node/blob/main/lib/internal/util/inspect.js... there's a lot that we likely don't care about or may not want and it's all a fairly complicated bit of code so "easy" is going to be subjective. |
Thinking about deploying workerd in the wild, I would probably be shipping all logs to somewhere like datadog with different Another problem is JS errors and stack traces, right now it's printed like:
The error is also logged more than once, which isn't ideal. Also, as mentioned in the readme, I would like some way to separate worker logs from workerd logs. Maybe this is the cause of errors being logged multiple times? This separation is crucial for me to figure out when workers are failing not because of app code, but a bug/error in workerd itself. And finally, there's no way to collect metrics or other instrumentation - to monitor (on a per worker basis) req/s, memory/cpu usage etc. This also links to being able to attach trace IDs to a group of logs for a single request. Maybe instrumentation and error stack traces can should be separate issues though, I'm not sure. |
Also, +1 on mirroring Node's console logging here or at least getting close to it. Seeing |
It would be great to see |
I would like a simple way to have workerd push just the userland script stdout to a file. Currently, using the
--verbose
flag userland code is a) in stderr, b) wrapped around and escaped beyond repair.The fact that the verbose logs are escaped and wrapped removes the ability to e.g. capture a universal library's test suite TAP output to evaluate.
The text was updated successfully, but these errors were encountered: