A problem that function developers run into: Emitting a debug log message to stdout. Because stdout is used for machine-to-machine protocol [1], it leads to cryptic failures from kpt fn. In Typescript, we actually override console.log to write to stderr, but we need a more uniform solution across different languages.
Consider:
Introduce logger utilities in the libraries as the recommended approach to debug logging
Improve the error message when the developer accidentally writes to stdout when do they don't use the logging utility provided.
A problem that function developers run into: Emitting a debug log message to stdout. Because stdout is used for machine-to-machine protocol [1], it leads to cryptic failures from
kpt fn
. In Typescript, we actually overrideconsole.log
to write to stderr, but we need a more uniform solution across different languages.Consider:
[1] https://github.com/kubernetes-sigs/kustomize/blob/master/cmd/config/docs/api-conventions/functions-spec.md