logger

package
v0.0.0-...-84116e0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log interface {
	ChiMiddleware() func(http.Handler) http.Handler
	NodeLogger(plan, runID, node string) Log
	Info(msg string, args ...interface{})
	Error(msg string, args ...interface{})
	Warning(msg string, args ...interface{})
	Debug(msg string, args ...interface{})
}

Log is the interface used by the agent and mesh server

type Logger

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

Logger service

func New

func New(opts ...zap.Option) (*Logger, func() error)

New creates a new Logger

func NewCustom

func NewCustom(logger *zap.Logger) (*Logger, func() error)

NewCustom creates a new Logger with custom zap logger

func NewDevelopment

func NewDevelopment(opts ...zap.Option) (*Logger, func() error)

NewDevelopment creates a new Logger for development

func (*Logger) ChiMiddleware

func (l *Logger) ChiMiddleware() func(http.Handler) http.Handler

ChiMiddleware returns a chi specific logging middleware

func (*Logger) Debug

func (l *Logger) Debug(msg string, args ...interface{})

Debug log type every 2 args are added as key=value

func (*Logger) Error

func (l *Logger) Error(msg string, args ...interface{})

Error log type every 2 args are added as key=value

func (*Logger) Info

func (l *Logger) Info(msg string, args ...interface{})

Info log type every 2 args are added as key=value

func (*Logger) Named

func (l *Logger) Named(name string) *Logger

Named for namespacing logs

func (*Logger) NodeLogger

func (l *Logger) NodeLogger(plan, runID, node string) Log

NodeLogger is logger used during node run

func (*Logger) Warning

func (l *Logger) Warning(msg string, args ...interface{})

Warning log trype every 2 args are added as key=value

Jump to

Keyboard shortcuts

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