MCPcopy
hub / github.com/uber-go/zap / Fatal

Method Fatal

logger.go:294–298  ·  view source on GitHub ↗

Fatal logs a message at FatalLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger. The logger then calls os.Exit(1), even if logging at FatalLevel is disabled.

(msg string, fields ...Field)

Source from the content-addressed store, hash-verified

292// The logger then calls os.Exit(1), even if logging at FatalLevel is
293// disabled.
294func (log *Logger) Fatal(msg string, fields ...Field) {
295 if ce := log.check(FatalLevel, msg); ce != nil {
296 ce.Write(fields...)
297 }
298}
299
300// Sync calls the underlying Core's Sync method, flushing any buffered log
301// entries. Applications should take care to call Sync before exiting.

Callers 11

TestSugarFatalLoggingFunction · 0.45
TestLoggerLogFatalFunction · 0.45
TestLoggerAlwaysFatalsFunction · 0.45
TestLoggerFatalOnNoopFunction · 0.45
TestLoggerCustomOnFatalFunction · 0.45
TestLoggerWithFatalHookFunction · 0.45
mainFunction · 0.45
BenchmarkWithoutFieldsFunction · 0.45
BenchmarkAddingFieldsFunction · 0.45

Calls 2

checkMethod · 0.95
WriteMethod · 0.65

Tested by 10

TestSugarFatalLoggingFunction · 0.36
TestLoggerLogFatalFunction · 0.36
TestLoggerAlwaysFatalsFunction · 0.36
TestLoggerFatalOnNoopFunction · 0.36
TestLoggerCustomOnFatalFunction · 0.36
TestLoggerWithFatalHookFunction · 0.36
BenchmarkWithoutFieldsFunction · 0.36
BenchmarkAddingFieldsFunction · 0.36