Fatal() does os.Exit(1) when Nop() log is disabled
Author: lbergesioCreated Sep 8, 2022Updated Jan 12, 2026
I think this is an error, It was discovered after upgrading from 1.26.1 to 1.28.0:
Fatal() here https://github.com/rs/zerolog/blob/d894f123bc5c2a887c95e90218b9410563141d67/log.go#L367
calls newEvent https://github.com/rs/zerolog/blob/d894f123bc5c2a887c95e90218b9410563141d67/log.go#L444
with the done paremeter being os.Exit(1) so here even the log is disabled, done is executed which was not like this before:
https://github.com/rs/zerolog/blob/d894f123bc5c2a887c95e90218b9410563141d67/log.go#L448
Source: rs/zerolog