func (rec *LogRec) Fields() []Field {
	return rec.fieldsAll
}
Fields returns this log record's Fields.
package logr
import (
	"fmt"
	"path/filepath"
	"runtime"
	"strings"
	"sync"
	"time"
)
type LogRec struct {
	mux  sync.RWMutex
	time time.Time
	level  Level
	logger Logger
	msg     string
	newline bool
	fields  []Field
	stackPC    []uintptr
	stackCount int
	flush chan struct{}
	frames    []runtime.Frame
	fieldsAll []Field
	caller    string
}
func NewLogRec(lvl Level, logger Logger, msg string, fields []Field, incStacktrace bool) *LogRec {
	rec := &LogRec{time: time.Now(), logger: logger, level: lvl, msg: msg, fields: fields}
	if incStacktrace {
		rec.stackPC = make([]uintptr, DefaultMaxStackFrames)
		rec.stackCount = runtime.Callers(2, rec.stackPC)
	}
	return rec
}
func newFlushLogRec(logger Logger) *LogRec {
	return &LogRec{logger: logger, flush: make(chan struct{})}
}
func (rec *LogRec) prep() {
	rec.mux.Lock()
	defer rec.mux.Unlock()
	rec.fieldsAll = make([]Field, 0, len(rec.fields)+len(rec.logger.fields))
	rec.fieldsAll = append(rec.fieldsAll, rec.logger.fields...)
	rec.fieldsAll = append(rec.fieldsAll, rec.fields...)
	filter := rec.logger.lgr.options.stackFilter
	if rec.stackCount > 0 {
		rec.frames = make([]runtime.Frame, 0, rec.stackCount)
		frames := runtime.CallersFrames(rec.stackPC[:rec.stackCount])
		for {
			frame, more := frames.Next()
			pkg := ResolvePackageName(frame.Function)
			if _, ok := filter[pkg]; !ok && pkg != "" {
				rec.frames = append(rec.frames, frame)
			}
			if !more {
				break
			}
		}
	}
	if len(rec.frames) > 0 {
		rec.caller = calcCaller(rec.frames)
	}
}
func (rec *LogRec) WithTime(time time.Time) *LogRec {
	rec.mux.RLock()
	defer rec.mux.RUnlock()
	return &LogRec{
		time:       time,
		level:      rec.level,
		logger:     rec.logger,
		msg:        rec.msg,
		newline:    rec.newline,
		fields:     rec.fields,
		stackPC:    rec.stackPC,
		stackCount: rec.stackCount,
		frames:     rec.frames,
	}
}
func (rec *LogRec) Logger() Logger {
	return rec.logger
}
func (rec *LogRec) Time() time.Time {
	return rec.time
}
func (rec *LogRec) Level() Level {
	return rec.level
}