Skip to content

Fatal() does os.Exit(1) when Nop() log is disabled #473

@lbergesio

Description

@lbergesio

I think this is an error, It was discovered after upgrading from 1.26.1 to 1.28.0:

Fatal() here

zerolog/log.go

Line 367 in d894f12

return l.newEvent(FatalLevel, func(msg string) { os.Exit(1) })

calls newEvent

zerolog/log.go

Line 444 in d894f12

func (l *Logger) newEvent(level Level, done func(string)) *Event {

with the done paremeter being os.Exit(1) so here even the log is disabled, done is executed which was not like this before:

zerolog/log.go

Line 448 in d894f12

done("")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions