utilsLog

package
v0.0.0-...-7ec6a99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogOption

type LogOption func(o *logOptions)

func WithCaller

func WithCaller() LogOption

func WithLevelDebug

func WithLevelDebug() LogOption

func WithLevelError

func WithLevelError() LogOption

func WithLevelInfo

func WithLevelInfo() LogOption

func WithLevelWarn

func WithLevelWarn() LogOption

func WithLogUnixTimestamp

func WithLogUnixTimestamp() LogOption
func WithOutputFileLink(path string, filename string) LogOption

func WithOutputFilePath

func WithOutputFilePath(path string, pattern string) LogOption

func WithOutputFileRotate

func WithOutputFileRotate(maxFiles uint, rotationTime time.Duration) LogOption

func WithPrefix

func WithPrefix(prefix map[string]interface{}) LogOption

type Xloger

type Xloger struct {
	// contains filtered or unexported fields
}

func NewXloger

func NewXloger(opts ...LogOption) (*Xloger, error)

func (*Xloger) AppendTimeDelay

func (l *Xloger) AppendTimeDelay(tstart time.Time, log zerolog.Logger) zerolog.Logger

func (*Xloger) Writer

func (l *Xloger) Writer() *zerolog.Logger

func (*Xloger) WriterWithPrefix

func (l *Xloger) WriterWithPrefix(prefix map[string]string) zerolog.Logger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL