-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
Currently, the encoder doesn't accept colors in field keys. Example:
package main
import (
"os"
"github.com/fatih/color"
"github.com/go-logfmt/logfmt"
)
func main() {
key := color.New(color.FgGreen).Sprintf("mykey")
e := logfmt.NewEncoder(os.Stdout)
e.EncodeKeyval(key, "myvalue")
e.EndRecord()
// will print "[32mmykey[0m=myvalue", without color
}I'm not sure how to allow them, while keeping your invalid character filtering, but I think handling colors would have real use cases
Metadata
Metadata
Assignees
Labels
No labels