This PR changes the default console module printer to use stdout or stderr similarly as in Node.js. It also adds the console.info and console.debug aliases.
The existing Printer interface is not modified to minimize the breaking changes, but still in some situations this could be a breaking change if someone relies on the existing logs destination, so I will understand if you don't want to merge it.
The default Go logger always print to stderr.
This PR changes the default
console
module printer to use stdout or stderr similarly as in Node.js. It also adds theconsole.info
andconsole.debug
aliases.Based on the Node.js
console
module docs:stdout
stderr
log
; prints tostdout
log
; prints tostdout
error
; prints tostderr
The existing
Printer
interface is not modified to minimize the breaking changes, but still in some situations this could be a breaking change if someone relies on the existing logs destination, so I will understand if you don't want to merge it.Just to for more context, this was reported in https://github.com/pocketbase/pocketbase/discussions/3024#discussioncomment-6591840 as the user wasn't expecting the
console.log
messages to end up in their stderr file.