logger

package
v3.0.0-...-c98e9ca Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console struct{}

func (*Console) Flush

func (l *Console) Flush() error

func (*Console) Log

func (l *Console) Log(message *Message)

func (*Console) Name

func (l *Console) Name() string

type Logger

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

func New

func New(outputs ...Output) *Logger

func (*Logger) AddOutput

func (l *Logger) AddOutput(output Output)

func (*Logger) Flush

func (l *Logger) Flush()

func (*Logger) Log

func (l *Logger) Log(message *Message)

type Message

type Message struct {
	Level   string    `json:"log"`
	Message string    `json:"message"`
	Data    []any     `json:"data,omitempty"`
	Sender  string    `json:"-"`
	Time    time.Time `json:"-"`
}

type Output

type Output interface {
	Name() string
	Log(message *Message)
	Flush() error
}

Jump to

Keyboard shortcuts

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