1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-08-04 21:42:57 +02:00

Exit on log.Fatal (#1297)

This commit is contained in:
ben-toogood
2020-03-04 13:46:01 +00:00
committed by GitHub
parent 6d803d9e45
commit 9386f36a13

View File

@ -1,5 +1,7 @@
package logger
import "os"
type Helper struct {
Logger
fields map[string]interface{}
@ -51,10 +53,12 @@ func (h *Helper) Errorf(template string, args ...interface{}) {
func (h *Helper) Fatal(args ...interface{}) {
h.Logger.Fields(h.fields).Log(ErrorLevel, args...)
os.Exit(1)
}
func (h *Helper) Fatalf(template string, args ...interface{}) {
h.Logger.Fields(h.fields).Logf(ErrorLevel, template, args...)
os.Exit(1)
}
func (h *Helper) WithError(err error) *Helper {