Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SetFormatter = xLOG.SetFormatter SetOutput = xLOG.SetOutput SetLevel = xLOG.SetLevel SetReportCaller = xLOG.SetReportCaller )
Functions ¶
Types ¶
type JSONLoggerFormatter ¶
type JSONLoggerFormatter struct { }
func (JSONLoggerFormatter) Format ¶
func (formatter JSONLoggerFormatter) Format(entry *logrus.Entry) ([]byte, error)
FormatDefault = "[${serviceName},${traceID},${spanID},${parentSpanID}][${pid}]"
timestamp := entry.Time.Format("2006-01-02 15:04:05")
return []byte(fmt.Sprintf("%s %s %s\n", timestamp, strings.ToUpper(entry.Level.String()), entry.Message)), nil
type MDReaderWriter ¶
func (MDReaderWriter) ForeachKey ¶
func (c MDReaderWriter) ForeachKey(handler func(key, val string) error) error
func (MDReaderWriter) Set ¶
func (c MDReaderWriter) Set(key, val string)
type Msg ¶
type Msg struct {
// contains filtered or unexported fields
}
func (*Msg) MarshalJSON ¶
func (*Msg) UnmarshalJSON ¶
type TextLoggerFormatter ¶
type TextLoggerFormatter struct { }
func (TextLoggerFormatter) Format ¶
func (formatter TextLoggerFormatter) Format(entry *logrus.Entry) ([]byte, error)
FormatDefault = "[${serviceName},${traceID},${spanID},${parentSpanID}][${pid}]"
timestamp := entry.Time.Format("2006-01-02 15:04:05")
return []byte(fmt.Sprintf("%s %s %s\n", timestamp, strings.ToUpper(entry.Level.String()), entry.Message)), nil
Click to show internal directories.
Click to hide internal directories.