logger

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLogger

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

DefaultLogger default logging controller

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug() *zerolog.Event

Debug log something at debug level.

func (*DefaultLogger) Err

func (l *DefaultLogger) Err(err error) *zerolog.Event

Err log something at Err level

func (*DefaultLogger) Error

func (l *DefaultLogger) Error() *zerolog.Event

Error log something at Error level

func (*DefaultLogger) Fatal

func (l *DefaultLogger) Fatal() *zerolog.Event

Fatal log something at fatal level. This will panic!

func (*DefaultLogger) Info

func (l *DefaultLogger) Info() *zerolog.Event

Info log something at fatal level.

func (*DefaultLogger) Log

func (l *DefaultLogger) Log() *zerolog.Event

Log log something at fatal level.

func (*DefaultLogger) RegisterSSEHook

func (l *DefaultLogger) RegisterSSEHook(sse *sse.Server)

func (*DefaultLogger) SetLogLevel

func (l *DefaultLogger) SetLogLevel(level string)

func (*DefaultLogger) Trace

func (l *DefaultLogger) Trace() *zerolog.Event

Trace log something at fatal level. This will panic!

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn() *zerolog.Event

Warn log something at warning level.

func (*DefaultLogger) With

func (l *DefaultLogger) With() zerolog.Context

With log with context

type LogMessage

type LogMessage struct {
	Time    string `json:"time"`
	Level   string `json:"level"`
	Message string `json:"message"`
}

func (LogMessage) ToJsonString

func (m LogMessage) ToJsonString() string

type Logger

type Logger interface {
	Log() *zerolog.Event
	Fatal() *zerolog.Event
	Err(err error) *zerolog.Event
	Error() *zerolog.Event
	Warn() *zerolog.Event
	Info() *zerolog.Event
	Trace() *zerolog.Event
	Debug() *zerolog.Event
	With() zerolog.Context
	RegisterSSEHook(sse *sse.Server)
	SetLogLevel(level string)
}

Logger interface

func Mock

func Mock() Logger

func New

func New(cfg *domain.Config) Logger

type ServerSentEventHook

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

func (*ServerSentEventHook) Run

func (h *ServerSentEventHook) Run(e *zerolog.Event, level zerolog.Level, msg string)

Jump to

Keyboard shortcuts

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