logg

package
v0.0.0-...-5c1fc54 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidLevelValues

func ValidLevelValues() (result []string)

Types

type Fields

type Fields map[string]interface{}

type Level

type Level int
const (
	Panic Level = iota
	Fatal
	Error
	Warning
	Info
	Debug
	Trace
)

func Levels

func Levels() []Level

func NewLevelFromValue

func NewLevelFromValue(val string) Level

func (Level) String

func (i Level) String() string

func (Level) Value

func (i Level) Value() string

type Logg

type Logg interface {
	WithField(key string, value interface{}) Logg
	WithFields(fields Fields) Logg
	WithError(err error) Logg
	WithPrefix(prefix string) Logg
	AddPrefixPath(prefix string) Logg
	Data() Fields
	Level() Level
	Output() io.Writer
	Spawn() Logg
	SetOutput(output io.Writer)
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Tracef(format string, args ...interface{})
	Trace(args ...interface{})
	WithLazyField(key string, fnc func() interface{}) (result Logg)
}

Main logger interface

type LogrusLogg

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

Logrus logg implementation

func NewLogrusLogg

func NewLogrusLogg(logrusInput interface{}) *LogrusLogg

func (*LogrusLogg) AddPrefixPath

func (l *LogrusLogg) AddPrefixPath(prefix string) Logg

func (*LogrusLogg) Data

func (l *LogrusLogg) Data() (result Fields)

func (*LogrusLogg) Debug

func (l *LogrusLogg) Debug(args ...interface{})

func (*LogrusLogg) Debugf

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

func (*LogrusLogg) Error

func (l *LogrusLogg) Error(args ...interface{})

func (*LogrusLogg) Errorf

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

func (*LogrusLogg) Info

func (l *LogrusLogg) Info(args ...interface{})

func (*LogrusLogg) Infof

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

func (*LogrusLogg) Level

func (l *LogrusLogg) Level() Level

func (*LogrusLogg) Output

func (l *LogrusLogg) Output() io.Writer

func (*LogrusLogg) SetOutput

func (l *LogrusLogg) SetOutput(output io.Writer)

func (*LogrusLogg) Spawn

func (l *LogrusLogg) Spawn() Logg

func (*LogrusLogg) Trace

func (l *LogrusLogg) Trace(args ...interface{})

func (*LogrusLogg) Tracef

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

func (*LogrusLogg) Warn

func (l *LogrusLogg) Warn(args ...interface{})

func (*LogrusLogg) Warnf

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

func (*LogrusLogg) WithError

func (l *LogrusLogg) WithError(err error) Logg

func (*LogrusLogg) WithField

func (l *LogrusLogg) WithField(key string, value interface{}) (result Logg)

func (*LogrusLogg) WithFields

func (l *LogrusLogg) WithFields(fields Fields) (result Logg)

func (*LogrusLogg) WithLazyField

func (l *LogrusLogg) WithLazyField(key string, fnc func() interface{}) (result Logg)

func (*LogrusLogg) WithPrefix

func (l *LogrusLogg) WithPrefix(prefix string) Logg

type StdoutFileWriter

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

func New

func New(logFilePath string) (result *StdoutFileWriter)

func (*StdoutFileWriter) DisableStdout

func (l *StdoutFileWriter) DisableStdout()

func (*StdoutFileWriter) Reset

func (l *StdoutFileWriter) Reset()

func (*StdoutFileWriter) Write

func (l *StdoutFileWriter) 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