OnWrite implements the OnWrite method to keep CheckWriteAction compatible with the new CheckWriteHook interface which deprecates CheckWriteAction.
(ce *CheckedEntry, _ []Field)
| 189 | // OnWrite implements the OnWrite method to keep CheckWriteAction compatible |
| 190 | // with the new CheckWriteHook interface which deprecates CheckWriteAction. |
| 191 | func (a CheckWriteAction) OnWrite(ce *CheckedEntry, _ []Field) { |
| 192 | switch a { |
| 193 | case WriteThenGoexit: |
| 194 | runtime.Goexit() |
| 195 | case WriteThenPanic: |
| 196 | panic(ce.Message) |
| 197 | case WriteThenFatal: |
| 198 | exit.With(1) |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | var _ CheckWriteHook = CheckWriteAction(0) |
| 203 |