Cloud Functions only distinguishes between stdout & stderr.
The docs on Writing, Viewing, and Responding to Logs say that "Cloud Functions includes simple logging by default. Logs written to stdout or stderr will appear automatically". The logging docs page that you referenced mentions the same thing about stdout & stderr being automatic for Cloud Functions.
My interpretation is that console.warn()
is going to stderr, and once there the distinction between warn and error is lost. I suspect you'd see the same for console.debug(
) showing up as INFO. I have this behavior in VMs when stderr is used, but I think App Engine does not have this problem.
I don't think the logging docs page is suggesting Bunyan specifically. It addresses Winston similarly, as well as a client library (in which case authentication should just work).
Error Reporting has a specific notion of what constitutes an "error" to be captured: https://cloud.google.com/error-reporting/docs/formatting-error-messages
console.warn()
? – Biondo