Fatal logs the msg and fields at LevelFatal. It will then Sync() and os.Exit(1).
(ctx context.Context, msg string, fields ...Field)
| 114 | // |
| 115 | // It will then Sync() and os.Exit(1). |
| 116 | func (l Logger) Fatal(ctx context.Context, msg string, fields ...Field) { |
| 117 | l.log(ctx, LevelFatal, msg, fields) |
| 118 | l.Sync() |
| 119 | |
| 120 | if l.exit == nil { |
| 121 | l.exit = defaultExitFn |
| 122 | } |
| 123 | |
| 124 | l.exit(1) |
| 125 | } |
| 126 | |
| 127 | // With returns a Logger that prepends the given fields on every |
| 128 | // logged entry. |