When using a prefix in stdlib's logger StdLibAdapter extracts the fields from log line incorrectly.
For example, the program
package main
import (
"log"
"os"
gokitlog "github.com/go-kit/kit/log"
)
func main() {
logg := log.New(gokitlog.NewStdlibAdapter(gokitlog.NewLogfmtLogger(os.Stdout)),
"some prefix ", log.LstdFlags)
logg.Println("log line")
}
will give us the following to the stdout:
caller="some prefix 2020/11/16 22:33" msg=":04 log line"
I have a fix to support the prefix mode by adding a method Prefix(prefix string, joinPrefixToMsg bool) StdlibAdapterOption