logger

package
v0.0.0-...-8f9ce2e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingHookName = errors.New("missing hook name")
	ErrNoHookHandler   = errors.New("No hook handler")
)

Functions

func Configure

func Configure(l *goapp.Lifecycle, conf *config.Config)

func GetHook

func GetHook(conf map[string]interface{}) (log.Hook, error)

func GetLoggerFromContext

func GetLoggerFromContext(c web.C) *log.Entry

func GetMiddleware

func GetMiddleware(logger *log.Logger) func(c *web.C, h http.Handler) http.Handler

func GetValue

func GetValue(name string, conf map[string]interface{}, d ...interface{}) interface{}

Types

type DispatchHook

type DispatchHook struct {
	Hooks map[log.Level][]log.Hook
}

func (*DispatchHook) Add

func (d *DispatchHook) Add(h log.Hook, l log.Level)

func (*DispatchHook) Fire

func (d *DispatchHook) Fire(e *log.Entry) error

func (*DispatchHook) Levels

func (d *DispatchHook) Levels() []log.Level

type MockedHook

type MockedHook struct {
	mock.Mock
}

func (*MockedHook) Fire

func (m *MockedHook) Fire(e *log.Entry) error

func (*MockedHook) Levels

func (m *MockedHook) Levels() []log.Level

Jump to

Keyboard shortcuts

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