logrus

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

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

New builds a new logger based on options

func ReportCaller

func ReportCaller() logger.Option

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

func WithExitFunc

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

func WithJSONFormatter

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

func WithLevelHooks

func WithLevelHooks(hooks logrus.LevelHooks) logger.Option

func WithLogger

func WithLogger(l logrus.StdLogger) logger.Option

func WithTextTextFormatter

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

Types

type Options

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

Jump to

Keyboard shortcuts

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