logging: avoids logging activity to stdio file descriptors (#1007)

This avoids logging activity on stdio file descriptors, in order to help
make troubleshooting easier. Usually, there isn't an issue in these, yet
wasm panics are harder to read if there is also logging of the ..
logging.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2023-01-04 16:04:40 +08:00
committed by GitHub
parent 3ab7e4b36d
commit f8a33cef8d
11 changed files with 73 additions and 80 deletions

View File

@@ -53,7 +53,7 @@ type Writer interface {
// ValueTypeString, it would read `vals[i+1]` and write the string from memory.
type ValWriter func(ctx context.Context, mod api.Module, w Writer, i uint32, vals []uint64)
func ValueLoggers(fnd api.FunctionDefinition) (paramLoggers []ParamLogger, resultLoggers []ResultLogger) {
func Config(fnd api.FunctionDefinition) (paramLoggers []ParamLogger, resultLoggers []ResultLogger) {
if paramLen := uint32(len(fnd.ParamTypes())); paramLen > 0 {
paramLoggers = make([]ParamLogger, paramLen)
hasParamNames := len(fnd.ParamNames()) > 0