logrus

package module
v0.0.0-...-bf09db0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 12 Imported by: 4

README

logrus

example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitFunc

func ExitFunc(exit func(int)) logger.Option

func JSONFormatter

func JSONFormatter(formatter *logrus.JSONFormatter) logger.Option

func NewLogger

func NewLogger(opts ...logger.Option) logger.Logger

New builds a new logger based on options

func ReportCaller

func ReportCaller(r bool) logger.Option

warning to use this option. because logrus doest not open CallerDepth option this will only print this package

func SplitLevel

func SplitLevel(s bool) logger.Option

func TextFormatter

func TextFormatter(formatter *logrus.TextFormatter) logger.Option

func TimestampFormat

func TimestampFormat(format string) logger.Option

func WithoutKey

func WithoutKey(w bool) logger.Option

func WithoutQuote

func WithoutQuote(w bool) logger.Option

Types

type Options

type Options struct {
	logger.Options
	Formatter logrus.Formatter
	// Flag for whether to log caller info (off by default)
	ReportCaller    bool
	SplitLevel      bool
	WithoutKey      bool
	WithoutQuote    bool
	TimestampFormat string
	// Exit Function to call when FatalLevel log
	ExitFunc func(int)
}

type PersistenceLevelHook

type PersistenceLevelHook struct {
	Writer io.Writer
	Fired  bool
	// contains filtered or unexported fields
}

func (*PersistenceLevelHook) Fire

func (hook *PersistenceLevelHook) Fire(entry *ls.Entry) error

func (*PersistenceLevelHook) Levels

func (hook *PersistenceLevelHook) Levels() []ls.Level

Directories

Path Synopsis
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
hooks/test
The Test package is used for testing logrus.
The Test package is used for testing logrus.
Package lumberjack provides a rolling logger.
Package lumberjack provides a rolling logger.
test

Jump to

Keyboard shortcuts

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