logger

package
v0.0.0-...-d389d3b Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type FxZapLoggerDecorator

type FxZapLoggerDecorator struct {
	FxZapLogger fxevent.ZapLogger
}

FxZapLoggerDecorator is a Fx event logger decorator that logs events to Zap.

func NewFxZapLoggerDecorator

func NewFxZapLoggerDecorator(zapLogger *zap.Logger) *FxZapLoggerDecorator

func (*FxZapLoggerDecorator) LogEvent

func (l *FxZapLoggerDecorator) LogEvent(event fxevent.Event)

LogEvent logs the given event to the provided Zap logger.

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(template string, args ...interface{})
	Info(args ...interface{})
	Infof(template string, args ...interface{})
	Warn(args ...interface{})
	Warnf(template string, args ...interface{})
	Error(args ...interface{})
	Errorf(template string, args ...interface{})
	With(args ...interface{}) Logger
	GetFxLogger() fxevent.Logger
	GetGormLogger() gormLogger.Interface
	GetZapLogger() *zap.Logger
}

func NewLogger

func NewLogger(env env.Env) (Logger, error)

NewLogger get the logger.

type NopLogger

type NopLogger struct{}

func (NopLogger) Debug

func (n NopLogger) Debug(args ...interface{})

func (NopLogger) Debugf

func (n NopLogger) Debugf(template string, args ...interface{})

func (NopLogger) Error

func (n NopLogger) Error(args ...interface{})

func (NopLogger) Errorf

func (n NopLogger) Errorf(template string, args ...interface{})

func (NopLogger) GetFxLogger

func (n NopLogger) GetFxLogger() fxevent.Logger

func (NopLogger) GetGormLogger

func (n NopLogger) GetGormLogger() gormLogger.Interface

func (NopLogger) GetZapLogger

func (n NopLogger) GetZapLogger() *zap.Logger

func (NopLogger) Info

func (n NopLogger) Info(args ...interface{})

func (NopLogger) Infof

func (n NopLogger) Infof(template string, args ...interface{})

func (NopLogger) Warn

func (n NopLogger) Warn(args ...interface{})

func (NopLogger) Warnf

func (n NopLogger) Warnf(template string, args ...interface{})

func (NopLogger) With

func (n NopLogger) With(fields ...interface{}) Logger

Jump to

Keyboard shortcuts

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