go-kit: Sample Code for Function to Log

go-kit: Sample Code for Function to Log func getLogger() log.Logger { var logger log.Logger logger = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)) logger = log.With(logger, "instance_id", 123) return logger } The above function is easily usable in a go-kit project to log JSON style data. func myfun() { mylogger := getLogger() mylogger.Log("a key", "a value") } Reference https://github.com/go-kit/kit/tree/master/log Written with…

%d bloggers like this: