logger

package module
v0.0.0-...-0a1e1df Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 15 Imported by: 0

README

logger

Documentation

Index

Constants

View Source
const (
	Hourly = "@hourly"
	Daily  = "@daily"
)

cron

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger logger

func NewLogger

func NewLogger(options ...Option) *Logger

NewLogger new logger

func (*Logger) Debug

func (l *Logger) Debug(message string, fields map[string]any)

Debug debug

func (*Logger) Dispatcher

func (l *Logger) Dispatcher(d event.Dispatcher)

Dispatcher set event dispatcher

func (*Logger) Error

func (l *Logger) Error(message string, fields map[string]any)

Error error

func (*Logger) Fatal

func (l *Logger) Fatal(message string, fields map[string]any)

Fatal fatal

func (*Logger) Formatter

func (l *Logger) Formatter(formatter logger.Formatter)

Formatter set formatter

func (*Logger) Hooks

func (l *Logger) Hooks(hooks ...logger.Hook)

Hooks set hook

func (*Logger) Info

func (l *Logger) Info(message string, fields map[string]any)

Info info

func (*Logger) Outputs

func (l *Logger) Outputs(outputs ...io.Writer)

Outputs set outputs

func (*Logger) Panic

func (l *Logger) Panic(message string, fields map[string]any)

Panic panic

func (*Logger) Warn

func (l *Logger) Warn(message string, fields map[string]any)

Warn warn

type Manager

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

Manager logger manager

func NewManager

func NewManager() *Manager

NewManager new manager

func (*Manager) AddChannel

func (m *Manager) AddChannel(name string, logger logger.Logger)

AddChannel add channel

func (*Manager) Channel

func (m *Manager) Channel(name string) logger.Logger

Channel channel

func (*Manager) Debug

func (m *Manager) Debug(message string, context map[string]any)

Debug debug

func (*Manager) Dispatcher

func (m *Manager) Dispatcher(d event.Dispatcher)

Dispatcher set dispatcher for default logger

func (*Manager) Error

func (m *Manager) Error(message string, context map[string]any)

Error error

func (*Manager) Fatal

func (m *Manager) Fatal(message string, context map[string]any)

Fatal fatal

func (*Manager) Formatter

func (m *Manager) Formatter(formatter logger.Formatter)

Formatter set formatter for default logger

func (*Manager) Hooks

func (m *Manager) Hooks(hooks ...logger.Hook)

Hooks set hooks for default logger

func (*Manager) Info

func (m *Manager) Info(message string, context map[string]any)

Info info

func (*Manager) Outputs

func (m *Manager) Outputs(outputs ...io.Writer)

Outputs set outputs for default logger

func (*Manager) Panic

func (m *Manager) Panic(message string, context map[string]any)

Panic panic

func (*Manager) Warn

func (m *Manager) Warn(message string, context map[string]any)

Warn warn

type Option

type Option func(*Logger)

Option option

func Dispatcher

func Dispatcher(dispatcher event.Dispatcher) Option

Dispatcher set dispatcher

func Formatter

func Formatter(formatter logger.Formatter) Option

Formatter set formatter

func Hooks

func Hooks(hooks ...logger.Hook) Option

Hooks set hooks

func Outputs

func Outputs(outputs ...io.Writer) Option

Outputs set outputs

func ZapOptions

func ZapOptions(options ...zap.Option) Option

ZapOptions set zap core options

type RotateFileOutput

type RotateFileOutput struct {
	*lumberjack.Logger
	RotationTime time.Duration
	// contains filtered or unexported fields
}

RotateFileOutput rotate file output

func NewRotateFileOutput

func NewRotateFileOutput(
	filename string,
	maxSize int,
	maxAge int,
	maxBackups int,
	localTime bool,
	compress bool,
	rotationCron string,
) *RotateFileOutput

NewRotateFileOutput new rotate file output

type ServerProvider

type ServerProvider struct{}

ServerProvider logger server provider

func (*ServerProvider) Register

func (s *ServerProvider) Register(c container.Container)

Register register

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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