Issue:
When defining multiple loggers derived from the same rlog.With("key","value") with the same key having multiple values, the output on the CLI is malformed. A minimal working example based on the hello world template:
package hello
import (
"context"
"encore.dev/rlog"
)
//encore:api public path=/hello/:name
func World(ctx context.Context, name string) (*Response, error) {
logger := rlog.With("service", "hello")
logger.Info("Saying hello to " + name)
sublog1 := logger.With("module", "longnamemodule")
sublog2 := logger.With("module", "midnamemod")
sublog3 := logger.With("module", "shortmod")
sublog1.Info("This is a long module name")
sublog2.Info("This is a mid module name")
sublog3.Info("This is a short module name")
msg := "Hello, " + name + "!"
return &Response{Message: msg}, nil
}
type Response struct {
Message string
}
This results in a garbled output for sublog1 and sublog2, as the initial parts "longnamemodule" will be overwritten with "shortmod"d"ule" and "shortmod"d"" respectively.
Issue: When defining multiple loggers derived from the same
rlog.With("key","value")
with the same key having multiple values, the output on the CLI is malformed. A minimal working example based on the hello world template:This results in a garbled output for sublog1 and sublog2, as the initial parts "longnamemodule" will be overwritten with
"shortmod"d"ule"
and"shortmod"d""
respectively.