Use console.warn/console.info where appropriate#20252
Use console.warn/console.info where appropriate#20252timvandermeij merged 1 commit intomozilla:masterfrom
console.warn/console.info where appropriate#20252Conversation
|
The node legacy branch obviously works but it requires ffi (for npm canvas) while this one require no permission |
timvandermeij
left a comment
There was a problem hiding this comment.
Looks good to me, with the comment addressed and passing tests. Note that quite a few years ago in #10234 this approach was rejected, but revisiting this now it seems like a good idea to use the stderr/stdout streams for their intended purposes (in addition to the verbosity setting).
Please update the commit message to shortly describe why this change is beneficial for future context too.
324a64c to
ef72c19
Compare
|
Thanks I addressed your comments |
Change info to use console.info and warn function to use console.warn, this not only makes sense semantically but also in practice server side runtimes like deno write console.log to stdout, and console.warn to stderr (info goes to stdout, unfortunately?) this is important because logging to stdout can break some cli apps.
console.warn/console.info where appropriate
|
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/75a0cd0d6e21b96/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/c269f45d2a0af80/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/75a0cd0d6e21b96/output.txt Total script time: 2.92 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/c269f45d2a0af80/output.txt Total script time: 8.44 mins
|
|
Thanks! |
|
Thanks as well! |
Why: the practical reason is I have a pdf reader mcp , that uses deno + pdfjs, it works but shows this warning
Warning: Setting up fake worker.the problem is that warning is printed to stdout so it breaks the mcp.
By switching to console.warn deno will print to stderr which make it work correctly.
Here is the code btw to make pdfjs work with deno
DOMMatrix is expected to land on the next deno version (pr already done)