util/log/logger.go
func (l *LoggerBase) Log(lvl Level, msg string) {
	lvln, ok := levelNums[lvl]
	if !ok {
		panic("bad log level")
	}

	if lvln < levelNums[l.conf.Level] {
		return
	}

	var stack *string
	if lvln >= levelNums[l.conf.StackLevel] {
		tmp := string(debug.Stack())
		stack = &tmp
	}

	if err := l.log(lvl, msg, l.ctx, stack); err != nil {
		panic("failed to log: " + err.Error())
	}

	if lvl == Fatal {
		panic("fatal log event")
	}
}
func (l *LoggerBase) Log(lvl Level, msg string) {
	lvln, ok := levelNums[lvl]
	if !ok {
		panic("bad log level")
	}

	if lvln < levelNums[l.conf.Level] {
		return
	}

	var stack *string
	if lvln >= levelNums[l.conf.StackLevel] {
		tmp := string(debug.Stack())
		stack = &tmp
	}

	if err := l.log(lvl, msg, l.ctx, stack); err != nil {
		panic("failed to log: " + err.Error())
	}

	if lvl == Fatal {
		panic("fatal log event")
	}
}
func ( l * LoggerBase ) Log ( lvl Level , msg string ) { lvln , ok := levelNums [ lvl ] if ! ok { panic ( " " ) } if lvln < levelNums [ l . conf . Level ] { return } var stack * string if lvln >= levelNums [ l . conf . StackLevel ] { tmp := string ( debug . Stack ( ) ) stack = & tmp } if err := l . log ( lvl , msg , l . ctx , stack ) ; err != nil { panic ( " " + err . Error ( ) ) } if lvl == Fatal { panic ( " " ) } }
// Log adds a new log message with a given severity level.
Log adds a new log message with a given severity level .