lumber icon indicating copy to clipboard operation
lumber copied to clipboard

Exit on Fatal

Open zbindenren opened this issue 11 years ago • 3 comments

Hi

I like your Logger, but what I do not understand is, why you didn't put an os.exit(1) when logging Fatal like the standard go logger?

Maybe it would also be great if this is configurable.

Here the doc of the standard go logger: http://golang.org/pkg/log/#Logger.Fatalf

A panic log level would also be great.

BR, Rene

zbindenren avatar Sep 04 '13 11:09 zbindenren

Lumber is only intended to output logs. Having the logger end the program execution (e.g. with os.Exit) might not be the best behavior for all use cases. This way users can log the fatal message and then do whatever cleanup or shutdown that they need. But I can see the value in having it reflect the standard log package, so maybe I will add that as a configurable option.

jcelliott avatar Sep 05 '13 04:09 jcelliott

Would be great, thx.

zbindenren avatar Sep 05 '13 08:09 zbindenren

flag does something similar: http://golang.org/pkg/flag/#ErrorHandling

beatgammit avatar Oct 01 '13 02:10 beatgammit