For sharedmain
zap's Fatal should deterministically calculate the POSIX return code
#2495
Labels
area/test-and-release
kind/feature
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
/area test-and-release
/kind feature
Actual Behavior
The Zap's Fatal method is calling
os.Exit(1)
regardless of a message. This isn't the best UX choice. The POSIX return code could be used for quick assessment about a process failure. When the retcode is always equal1
for any error, this can't be utilized.Tools like Docker or Kubernetes report back the return code of the process. By using a deterministic algorithm to calculate the POSIX return code, a quick debugging is possible. Users could indicate if the process is failing because of the same reason, without looking into logs.
Expected Behavior
The best would be to rely on Fatal's message or on an error object if it's attached as a Field.
Additional Info
Related to uber-go/zap#1086
The text was updated successfully, but these errors were encountered: