sirupsen / logrus

Structured, pluggable logging for Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to print the user-defined structure in pretty way in log

zhuzhzh opened this issue · comments

by default, I use the following function to print my user-defined structure. but with logrus, I don't know how to achieve the similar format.

func PrettyPrint(i interface{}) string {
s, _ := json.MarshalIndent(i, "", "\t")
return string(s)
}

This issue is stale because it has been open for 30 days with no activity.

This issue was closed because it has been inactive for 14 days since being marked as stale.