MCPcopy Index your code
hub / github.com/coder/slog / Fatal

Method Fatal

slog.go:116–125  ·  view source on GitHub ↗

Fatal logs the msg and fields at LevelFatal. It will then Sync() and os.Exit(1).

(ctx context.Context, msg string, fields ...Field)

Source from the content-addressed store, hash-verified

114//
115// It will then Sync() and os.Exit(1).
116func (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.

Callers 4

TestLoggerFunction · 0.45
Example_multipleFunction · 0.45
TestExitFunction · 0.45
TestEntryFunction · 0.45

Calls 2

logMethod · 0.95
SyncMethod · 0.95

Tested by 4

TestLoggerFunction · 0.36
Example_multipleFunction · 0.36
TestExitFunction · 0.36
TestEntryFunction · 0.36