MCPcopy
hub / github.com/sirupsen/logrus / Entry

Struct Entry

entry.go:46–73  ·  view source on GitHub ↗

Entry is the final or intermediate Logrus logging entry. It contains all the fields passed with WithField{,s}. It's finally logged when Trace, Debug, Info, Warn, Error, Fatal or Panic is called on it. These objects can be reused and passed around as much as you wish to avoid field duplication. noli

Source from the content-addressed store, hash-verified

44//
45//nolint:recvcheck // the methods of "Entry" use pointer receiver and non-pointer receiver.
46type Entry struct {
47 Logger *Logger
48
49 // Contains all the fields set by the user.
50 Data Fields
51
52 // Time at which the log entry was created
53 Time time.Time
54
55 // Level the log entry was logged at: Trace, Debug, Info, Warn, Error, Fatal or Panic
56 // This field will be set on entry firing and the value will be equal to the one in Logger struct field.
57 Level Level
58
59 // Calling method, with package name
60 Caller *runtime.Frame
61
62 // Message passed to Trace, Debug, Info, Warn, Error, Fatal or Panic
63 Message string
64
65 // When formatter is called in entry.log(), a Buffer may be set to entry
66 Buffer *bytes.Buffer
67
68 // Contains the context set by the user. Useful for hook processing etc.
69 Context context.Context
70
71 // err may contain a field formatting error
72 err string
73}
74
75func NewEntry(logger *Logger) *Entry {
76 return &Entry{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected