log

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CtxRequestIDKeyType

type CtxRequestIDKeyType int

CtxRequestIDKeyType is a new type for CtxRequestIDKey

const (
	// CtxRequestIDKey is a key to get request id from context.
	CtxRequestIDKey CtxRequestIDKeyType = iota + 1
)

type Logger

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

Logger is a logger.

func New

func New(ctx context.Context) *Logger

New creates a new logger.

func (*Logger) Debug

func (l *Logger) Debug(msg string)

Debug emits DEBUG level log.

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...interface{})

Debugf emits DEBUG level log with formatter

func (*Logger) Error

func (l *Logger) Error(msg string)

Error emits ERROR level log.

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

Errorf emits ERROR level log.

func (*Logger) Info

func (l *Logger) Info(msg string)

Info emits INFO level log.

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

Infof emits INFO level log with formatter.

func (*Logger) SetOutput

func (l *Logger) SetOutput(out io.Writer)

SetOutput sets outputs.

func (*Logger) Trace

func (l *Logger) Trace(msg string)

Trace emits TRACE level log.

func (*Logger) Tracef

func (l *Logger) Tracef(format string, args ...interface{})

Tracef emits TRACE level log with formatter.

func (*Logger) Warn

func (l *Logger) Warn(msg string)

Warn emits WARN level log.

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...interface{})

Warnf emits WARN level log.

func (*Logger) WithFields

func (l *Logger) WithFields(m map[string]interface{}) *Logger

WithFields sets several fields.

func (*Logger) WithPrefix

func (l *Logger) WithPrefix(prefix string) *Logger

WithPrefix sets prefix.

Jump to

Keyboard shortcuts

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