log

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AddHook

func AddHook(hook Hook)

func AddHooks

func AddHooks(hooks ...Hook)

func AttachField

func AttachField(k string, v interface{})

func AttachFields

func AttachFields(kv Fields)

func Debug

func Debug(v ...interface{})

func Debugf

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

func Error

func Error(v ...interface{})

func Errorf

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

func Fatal

func Fatal(v ...interface{})

func Fatalf

func Fatalf(s string, v ...interface{})

func Info

func Info(v ...interface{})

func Infof

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

func NewConsoleHook

func NewConsoleHook(configs ...*ConsoleHookConfig) *hook

func NewFileHook

func NewFileHook(configs ...*FileHookConfig) *hook

func Panic

func Panic(v ...interface{})

func Panicf

func Panicf(s string, v ...interface{})

func SetLevel

func SetLevel(level Level)

func ToError added in v0.0.2

func ToError(i interface{}) error

func Warn

func Warn(v ...interface{})

func Warnf

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

Types

type ConsoleHookConfig

type ConsoleHookConfig struct {
	Level Level
}

type Entry

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

func Caller added in v0.0.2

func Caller(skip ...int) *Entry

func NewEntry

func NewEntry(l *Logger) *Entry

func WithContext

func WithContext(ctx context.Context) *Entry

func WithField

func WithField(k string, v interface{}) *Entry

func WithFields

func WithFields(kv Fields) *Entry

func (*Entry) Caller added in v0.0.2

func (e *Entry) Caller(skip ...int) *Entry

func (*Entry) Debug

func (e *Entry) Debug(v ...interface{})

func (*Entry) Debugf

func (e *Entry) Debugf(s string, v ...interface{})

func (*Entry) Error

func (e *Entry) Error(v ...interface{})

func (*Entry) Errorf

func (e *Entry) Errorf(s string, v ...interface{})

func (*Entry) Fatal

func (e *Entry) Fatal(v ...interface{})

func (*Entry) Fatalf

func (e *Entry) Fatalf(s string, v ...interface{})

func (*Entry) Info

func (e *Entry) Info(v ...interface{})

func (*Entry) Infof

func (e *Entry) Infof(s string, v ...interface{})

func (*Entry) Panic

func (e *Entry) Panic(v ...interface{})

func (*Entry) Panicf

func (e *Entry) Panicf(s string, v ...interface{})

func (*Entry) Warn

func (e *Entry) Warn(v ...interface{})

func (*Entry) Warnf

func (e *Entry) Warnf(s string, v ...interface{})

func (*Entry) WithContext

func (e *Entry) WithContext(ctx context.Context) *Entry

func (*Entry) WithField

func (e *Entry) WithField(k string, v interface{}) *Entry

func (*Entry) WithFields

func (e *Entry) WithFields(kv Fields) *Entry

type Fields

type Fields = logrus.Fields

func ToFields

func ToFields(kv ...interface{}) Fields

type FileHookConfig

type FileHookConfig struct {
	Level      Level
	ForceJSON  bool
	Filename   string
	MaxSize    int
	MaxAge     int
	MaxBackups int
	LocalTime  bool
	Compress   bool
}

type Formatter

type Formatter = logrus.Formatter

type Hook

type Hook = logrus.Hook

type JSONFormatter

type JSONFormatter = logrus.JSONFormatter

type Level

type Level uint32
const (
	PanicLevel Level = iota
	FatalLevel
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
)

func GetLevel

func GetLevel() Level

func ParseLevel

func ParseLevel(level string) (Level, error)

func (Level) MarshalText

func (level Level) MarshalText() ([]byte, error)

func (Level) String

func (level Level) String() string

func (*Level) UnmarshalText

func (level *Level) UnmarshalText(text []byte) error

type LevelHooks

type LevelHooks = logrus.LevelHooks

type Logger

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

func DefaultLogger

func DefaultLogger() *Logger

func New

func New() *Logger

func NewWithLevel

func NewWithLevel(level Level) *Logger

func (*Logger) AddHook

func (l *Logger) AddHook(hook Hook)

func (*Logger) AddHooks

func (l *Logger) AddHooks(hooks ...Hook)

func (*Logger) AttachField

func (l *Logger) AttachField(k string, v interface{})

func (*Logger) AttachFields

func (l *Logger) AttachFields(kv Fields)

func (*Logger) Caller added in v0.0.2

func (l *Logger) Caller(skip ...int) *Entry

func (*Logger) Debug

func (l *Logger) Debug(v ...interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(s string, v ...interface{})

func (*Logger) Error

func (l *Logger) Error(v ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(s string, v ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(v ...interface{})

func (*Logger) Fatalf

func (l *Logger) Fatalf(s string, v ...interface{})

func (*Logger) GetLevel

func (l *Logger) GetLevel() Level

func (*Logger) Info

func (l *Logger) Info(v ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(s string, v ...interface{})

func (*Logger) Panic

func (l *Logger) Panic(v ...interface{})

func (*Logger) Panicf

func (l *Logger) Panicf(s string, v ...interface{})

func (*Logger) ReplaceHooks

func (l *Logger) ReplaceHooks(hooks ...Hook)

func (*Logger) SetExitFunc added in v0.0.2

func (l *Logger) SetExitFunc(f func(int))

func (*Logger) SetFormatter

func (l *Logger) SetFormatter(formatter Formatter)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

func (*Logger) SetOutput

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

func (*Logger) Warn

func (l *Logger) Warn(v ...interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(s string, v ...interface{})

func (*Logger) WithContext

func (l *Logger) WithContext(ctx context.Context) *Entry

func (*Logger) WithField

func (l *Logger) WithField(k string, v interface{}) *Entry

func (*Logger) WithFields

func (l *Logger) WithFields(kv Fields) *Entry

type TextFormatter

type TextFormatter = logrus.TextFormatter

Jump to

Keyboard shortcuts

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