Closed rodrigorodrigues closed 10 months ago
Hi all,
I was able to change the log format for the one that I need but I was wondering how can I apply the colours like the ones for default TextFormatter?
type MyFormatter struct { } func (f *MyFormatter) Format(entry *logrus.Entry) ([]byte, error) { msg := fmt.Sprintf("%v %v sanctin-service-go %v", entry.Time, entry.Level, entry.Message) return []byte(msg), nil } func main() { log = logrus.New() // Default formatter /*formatter := &logrus.TextFormatter{ ForceColors: false, //Enable this for coloured output DisableColors: false, TimestampFormat: "2006-01-02T15:04:05.000", DisableTimestamp: false, FullTimestamp: true, }*/ log.SetFormatter(new(MyFormatter))
output with custom format.
output with default format.
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.
Hi all,
I was able to change the log format for the one that I need but I was wondering how can I apply the colours like the ones for default TextFormatter?
output with custom format.
output with default format.