New creates a new Core that buffers logs in memory (without any encoding). It's particularly useful in tests.
(enab zapcore.LevelEnabler)
| 153 | // New creates a new Core that buffers logs in memory (without any encoding). |
| 154 | // It's particularly useful in tests. |
| 155 | func New(enab zapcore.LevelEnabler) (zapcore.Core, *ObservedLogs) { |
| 156 | ol := &ObservedLogs{} |
| 157 | return &contextObserver{ |
| 158 | LevelEnabler: enab, |
| 159 | logs: ol, |
| 160 | }, ol |
| 161 | } |
| 162 | |
| 163 | type contextObserver struct { |
| 164 | zapcore.LevelEnabler |
no outgoing calls