Documentation ¶ Index ¶ Variables func NewHelper(l log.Logger) *log.Helper func NewLogger(opts ...Option) log.Logger func Trace() log.Valuer type Level type Option func WithLevel(l Level) Option func WithPath(path string) Option func WithTrace(enable bool) Option func WithZap(logger *zap.Logger) Option Constants ¶ This section is empty. Variables ¶ View Source var ( // DefaultLog is default tsf logger DefaultLogger log.Logger = NewLogger(WithTrace(true), WithPath(env.LogPath()), WithLevel(Level(env.LogLevel()))) DefaultLog *log.Helper = log.NewHelper(DefaultLogger) ) Functions ¶ func NewHelper ¶ func NewHelper(l log.Logger) *log.Helper NewHelper return tsf new logger helper func NewLogger ¶ func NewLogger(opts ...Option) log.Logger NewLogger return tsf new logger func Trace ¶ func Trace() log.Valuer Trace returns a traceid valuer. Types ¶ type Level ¶ type Level int8 const ( LevelDebug Level = iota - 1 LevelInfo LevelWarn LevelError LevelFatal ) type Option ¶ type Option func(t *options) func WithLevel ¶ func WithLevel(l Level) Option func WithPath ¶ func WithPath(path string) Option func WithTrace ¶ func WithTrace(enable bool) Option func WithZap ¶ func WithZap(logger *zap.Logger) Option Source Files ¶ View all Source files log.go Click to show internal directories. Click to hide internal directories.