loggerus

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONFormatter

type JSONFormatter struct {

	// Log time zone
	TimeZone string
	// contains filtered or unexported fields
}

func NewJSONFormatter

func NewJSONFormatter(timestampFormat string, timeZone string) (*JSONFormatter, error)

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(entry *logrus.Entry) ([]byte, error)

type Loggerus

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

func NewJSONLoggerus

func NewJSONLoggerus(name string, level logrus.Level, output io.Writer) (*Loggerus, error)

NewJSONLoggerus Creates a logger pre-configured for commands

func NewLoggerus

func NewLoggerus(name string, level logrus.Level, output io.Writer, formatter logrus.Formatter) (*Loggerus, error)

func NewTextLoggerus

func NewTextLoggerus(name string, level logrus.Level, output io.Writer) (*Loggerus, error)

func (*Loggerus) Debug

func (l *Loggerus) Debug(format interface{}, vars ...interface{})

Debug emits an unstructured debug log

func (*Loggerus) DebugCtx

func (l *Loggerus) DebugCtx(ctx context.Context, format interface{}, vars ...interface{})

DebugCtx emits an unstructured debug log with context

func (*Loggerus) DebugWith

func (l *Loggerus) DebugWith(format interface{}, vars ...interface{})

DebugWith emits a structured debug log

func (*Loggerus) DebugWithCtx

func (l *Loggerus) DebugWithCtx(ctx context.Context, format interface{}, vars ...interface{})

DebugWithCtx emits a structured debug log with context

func (*Loggerus) Error

func (l *Loggerus) Error(format interface{}, vars ...interface{})

Error emits an unstructured error log

func (*Loggerus) ErrorCtx

func (l *Loggerus) ErrorCtx(ctx context.Context, format interface{}, vars ...interface{})

ErrorCtx emits an unstructured error log with context

func (*Loggerus) ErrorWith

func (l *Loggerus) ErrorWith(format interface{}, vars ...interface{})

ErrorWith emits a structured error log

func (*Loggerus) ErrorWithCtx

func (l *Loggerus) ErrorWithCtx(ctx context.Context, format interface{}, vars ...interface{})

ErrorWithCtx emits a structured error log with context

func (*Loggerus) Flush

func (l *Loggerus) Flush()

Flush flushes buffered logs, if applicable

func (*Loggerus) GetChild

func (l *Loggerus) GetChild(name string) logger.Logger

GetChild returns a child logger, if underlying logger supports hierarchal logging

func (*Loggerus) Info

func (l *Loggerus) Info(format interface{}, vars ...interface{})

Info emits an unstructured informational log

func (*Loggerus) InfoCtx

func (l *Loggerus) InfoCtx(ctx context.Context, format interface{}, vars ...interface{})

InfoCtx emits an unstructured informational log with context

func (*Loggerus) InfoWith

func (l *Loggerus) InfoWith(format interface{}, vars ...interface{})

InfoWith emits a structured info log

func (*Loggerus) InfoWithCtx

func (l *Loggerus) InfoWithCtx(ctx context.Context, format interface{}, vars ...interface{})

InfoWithCtx emits a structured info log with context

func (*Loggerus) Warn

func (l *Loggerus) Warn(format interface{}, vars ...interface{})

Warn emits an unstructured warning log

func (*Loggerus) WarnCtx

func (l *Loggerus) WarnCtx(ctx context.Context, format interface{}, vars ...interface{})

WarnCtx emits an unstructured warning log with context

func (*Loggerus) WarnWith

func (l *Loggerus) WarnWith(format interface{}, vars ...interface{})

WarnWith emits a structured warning log

func (*Loggerus) WarnWithCtx

func (l *Loggerus) WarnWithCtx(ctx context.Context, format interface{}, vars ...interface{})

WarnWithCtx emits a structured warning log with context

type TextFormatter

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

func NewTextFormatter

func NewTextFormatter(maxVariableLen int, enrichWhoField bool) (*TextFormatter, error)

func (*TextFormatter) Format

func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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