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
| 44 | // |
| 45 | //nolint:recvcheck // the methods of "Entry" use pointer receiver and non-pointer receiver. |
| 46 | type 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 | |
| 75 | func NewEntry(logger *Logger) *Entry { |
| 76 | return &Entry{ |
nothing calls this directly
no outgoing calls
no test coverage detected