Core is a minimal, fast logger interface. It's designed for library authors to wrap in a more user-friendly API.
| 23 | // Core is a minimal, fast logger interface. It's designed for library authors |
| 24 | // to wrap in a more user-friendly API. |
| 25 | type Core interface { |
| 26 | LevelEnabler |
| 27 | |
| 28 | // With adds structured context to the Core. |
| 29 | With([]Field) Core |
| 30 | // Check determines whether the supplied Entry should be logged (using the |
| 31 | // embedded LevelEnabler and possibly some extra logic). If the entry |
| 32 | // should be logged, the Core adds itself to the CheckedEntry and returns |
| 33 | // the result. |
| 34 | // |
| 35 | // Callers must use Check before calling Write. |
| 36 | Check(Entry, *CheckedEntry) *CheckedEntry |
| 37 | // Write serializes the Entry and any Fields supplied at the log site and |
| 38 | // writes them to their destination. |
| 39 | // |
| 40 | // If called, Write should always log the Entry and Fields; it should not |
| 41 | // replicate the logic of Check. |
| 42 | Write(Entry, []Field) error |
| 43 | // Sync flushes buffered logs (if any). |
| 44 | Sync() error |
| 45 | } |
| 46 | |
| 47 | type nopCore struct{} |
| 48 |
no outgoing calls
no test coverage detected