logging

package
v0.0.0-...-f8ea316 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Syslog = "syslog"
)

Variables

View Source
var DefaultLogger = initDefaultLogger()

Functions

func AddHooks

func AddHooks(hooks ...logrus.Hook)

func SetLogFormat

func SetLogFormat(format LogFormat)

func SetLogLevel

func SetLogLevel(logLevel logrus.Level)

func SetLogLevelToDebug

func SetLogLevelToDebug()

func SetupLogging

func SetupLogging(logOpts ...LogOption)

Types

type LogFormat

type LogFormat string
const (
	LogFormatJson LogFormat = "json"
	LogFormatText LogFormat = "text"
)

func (LogFormat) LogrusFormat

func (lf LogFormat) LogrusFormat() logrus.Formatter

type LogOption

type LogOption func(*LogOptions)

func WithJsonFormat

func WithJsonFormat() LogOption

func WithLogFormat

func WithLogFormat(format LogFormat) LogOption

func WithLogLevel

func WithLogLevel(level string) LogOption

func WithLogOutputAsStderr

func WithLogOutputAsStderr() LogOption

func WithTextFormat

func WithTextFormat() LogOption

type LogOptions

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

type LogOutput

type LogOutput string
const (
	LogOutputStdout LogOutput = "stdout"
	LogOutputStderr LogOutput = "stderr"
)

func (LogOutput) Writer

func (lo LogOutput) Writer() io.Writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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