log

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLogConfig = &LogConfig{
	Level:  "info",
	Format: "console",
	Color:  false,
}

Functions

func Debug

func Debug() *zerolog.Event

func DumpLoggers

func DumpLoggers(name string)

func Error

func Error() *zerolog.Event

func Fatal

func Fatal() *zerolog.Event

func GetStdLogger

func GetStdLogger(l *zerolog.Logger) *glog.Logger

func Info

func Info() *zerolog.Event

func InitLoggerRedirect

func InitLoggerRedirect(logFileName string, defLog bool) error

func InitSyslog

func InitSyslog() (io.Writer, error)

func SetCloudLogLevel

func SetCloudLogLevel(level zerolog.Level)

func SetLoggersConfig

func SetLoggersConfig(config *LogConfig)

func Trace

func Trace() *zerolog.Event

func Warn added in v1.2.0

func Warn() *zerolog.Event

Types

type LogConfig

type LogConfig struct {
	Level      string
	Format     string
	Color      bool
	SampleRate float64 `json:"sample_rate" mapstructure:"sample_rate" yaml:"sample_rate"`
}

type LogHandle

type LogHandle struct {
	//	logrus.Logger
	*zerolog.Logger
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger(name string) *LogHandle

func NewLogger

func NewLogger(config *LogConfig, module string, colorized bool, writer io.Writer) *LogHandle

func (*LogHandle) Debugf

func (l *LogHandle) Debugf(msg string, args ...interface{})

func (*LogHandle) E

func (l *LogHandle) E(err error) bool

func (*LogHandle) Errorf

func (l *LogHandle) Errorf(msg string, args ...interface{})

func (*LogHandle) Infof

func (l *LogHandle) Infof(msg string, args ...interface{})

func (*LogHandle) IsLevelEnabled

func (l *LogHandle) IsLevelEnabled(level zerolog.Level) bool

func (*LogHandle) Log

func (l *LogHandle) Log(args ...interface{})

for aws.Logger

func (*LogHandle) SetLevel

func (l *LogHandle) SetLevel(level zerolog.Level)

func (*LogHandle) Warnf

func (l *LogHandle) Warnf(msg string, args ...interface{})

Jump to

Keyboard shortcuts

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