log

package
v0.0.0-...-cca27e0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Caller

func Caller(extends ...string) (string, int)

Caller return the file name and line number of the current file

func Close

func Close() error

Close if need

func Debugf

func Debugf(format string, v ...interface{})

Debugf debugf

func Errorf

func Errorf(format string, v ...interface{})

Errorf errorf

func Infof

func Infof(format string, v ...interface{})

Infof infof

func Regist

func Regist(l *Log)

Regist regist

func Warnf

func Warnf(format string, v ...interface{})

Warnf warnf

Types

type Log

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

Log log

func Get

func Get(name string) *Log

Get get

func NewLog

func NewLog(name string, writer io.Writer, opts ...Option) *Log

NewLog newLog

func SetWriter

func SetWriter(w io.Writer) *Log

SetWriter setwriter

func WithName

func WithName(name string, opts ...Option) *Log

WithName withName

func WithValues

func WithValues(k string, v interface{}) *Log

WithValues with values

func (*Log) Close

func (log *Log) Close() error

Close close

func (*Log) Debugf

func (log *Log) Debugf(format string, v ...any)

Debugf debugf

func (*Log) Errorf

func (log *Log) Errorf(format string, v ...any)

Errorf Errorf

func (*Log) Infof

func (log *Log) Infof(format string, v ...any)

Infof Infof

func (*Log) SetWriter

func (log *Log) SetWriter(w io.Writer) *Log

SetWriter set writer

func (*Log) Warnf

func (log *Log) Warnf(format string, v ...any)

Warnf Warnf

func (*Log) WithName

func (log *Log) WithName(name string, opts ...Option) *Log

WithName withName

func (*Log) WithValues

func (log *Log) WithValues(key string, value interface{}) *Log

WithValues withvalues

type Option

type Option func(*Options)

Option func

func Format

func Format(format string) Option

Format logformat

func TimeFormat

func TimeFormat(timeFormat string) Option

TimeFormat timeFormat

type Options

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

Options opts

type Rotate

type Rotate struct {
	Path string
	// contains filtered or unexported fields
}

func NewRotate

func NewRotate(path string, truncate time.Duration) (*Rotate, error)

func (*Rotate) Rotate

func (r *Rotate) Rotate() error

func (*Rotate) RotateSched

func (r *Rotate) RotateSched()

func (*Rotate) Write

func (r *Rotate) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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