Conversation
|
|
||
| # Unresolved Questions | ||
|
|
||
| - `flush` and `close` are asynchronous functions, and in the presence of multiple handlers we might need to await them. Should we call them without await? I wouldn't want to delay rendering. How do we catch errors if they fail? |
There was a problem hiding this comment.
I imagine an adapter could provide something like waitUntil which doesn't block the request, otherwise block the request
There was a problem hiding this comment.
Possibly, but probably we can forget of the flush function. We will revisit once waitUntil lands in the next minor
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
| }); | ||
| ``` | ||
|
|
||
| ### `logHandlers.node(config?)` |
There was a problem hiding this comment.
From the user perspective, is there any real difference between the console and node loggers? They do the same, right, one just only works in Node, in which case, why have it?
There was a problem hiding this comment.
They don't do the same thing.
Node.js uses stdout/stderr to print the messages.
Console prints to console via info/warn/error
There was a problem hiding this comment.
Console always prints to stdout/stderr though. Do you know if there's an advantage to having both? Or did you do it that way because we already had both in the codebase (which IIRC is just historical and not purposefully designed).
There was a problem hiding this comment.
Console always prints to stdout/stderr though
Do you mean that the runtime (Node.js, workderd, etc.) does that? If so, then it's an implementation detail.
Or did you do it that way because we already had both in the codebase (which IIRC is just historical and not purposefully designed).
Yes we do. CLI and Pipeline use two different loggers. CLI uses a node.js logger, while the pipeline uses the console logger. Additionally, I didn't exclude the idea that a user could create a client logger, so I wanted to keep things open ended for now.
Summary
Links