logger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	GetLogPrefix() string
}
var NilContext Context = &NilContextS{}

func NewSubContext

func NewSubContext(parent Context, child Context) Context

type ContextL

type ContextL interface {
	Context
	Debugf(f string, params ...interface{})
	Infof(f string, params ...interface{})
	Warnf(f string, params ...interface{})
	Errorf(f string, params ...interface{})

	// Methods accepting one-time subcontexts
	SDebugf(lc Context, f string, params ...interface{})
	SInfof(lc Context, f string, params ...interface{})
	SWarnf(lc Context, f string, params ...interface{})
	SErrorf(lc Context, f string, params ...interface{})

	GetLogger() L
	GetLogContext() Context
}

Logs within its Context.

func NewContextL

func NewContextL(lc Context, cl ContextL) ContextL

func NewContextLFromUnderlying

func NewContextLFromUnderlying(lc Context, ul Underlying) ContextL

func NewSubContextL

func NewSubContextL(subContext Context, cl ContextL) ContextL

type ContextLImpl

type ContextLImpl struct {
	Context
	L L
}

func (*ContextLImpl) Debugf

func (l *ContextLImpl) Debugf(f string, params ...interface{})

func (*ContextLImpl) Errorf

func (l *ContextLImpl) Errorf(f string, params ...interface{})

func (*ContextLImpl) GetLogContext

func (l *ContextLImpl) GetLogContext() Context

func (*ContextLImpl) GetLogger

func (l *ContextLImpl) GetLogger() L

func (*ContextLImpl) Infof

func (l *ContextLImpl) Infof(f string, params ...interface{})

func (*ContextLImpl) SDebugf

func (l *ContextLImpl) SDebugf(lc Context, f string, params ...interface{})

func (*ContextLImpl) SErrorf

func (l *ContextLImpl) SErrorf(lc Context, f string, params ...interface{})

func (*ContextLImpl) SInfof

func (l *ContextLImpl) SInfof(lc Context, f string, params ...interface{})

func (*ContextLImpl) SWarnf

func (l *ContextLImpl) SWarnf(lc Context, f string, params ...interface{})

func (*ContextLImpl) Warnf

func (l *ContextLImpl) Warnf(f string, params ...interface{})

type L

type L interface {
	Debugf(lc Context, f string, params ...interface{})
	Infof(lc Context, f string, params ...interface{})
	Warnf(lc Context, f string, params ...interface{})
	Errorf(lc Context, f string, params ...interface{})

	GetUnderlyingLogger() Underlying
}

Logs and lets you specify the context.

type LoggerImpl

type LoggerImpl struct {
	UL Underlying
}

func (*LoggerImpl) Debugf

func (l *LoggerImpl) Debugf(c Context, f string, params ...interface{})

func (*LoggerImpl) Errorf

func (l *LoggerImpl) Errorf(c Context, f string, params ...interface{})

func (*LoggerImpl) GetUnderlyingLogger

func (l *LoggerImpl) GetUnderlyingLogger() Underlying

func (*LoggerImpl) Infof

func (l *LoggerImpl) Infof(c Context, f string, params ...interface{})

func (*LoggerImpl) Warnf

func (l *LoggerImpl) Warnf(c Context, f string, params ...interface{})

type NilContextS

type NilContextS struct{}

func (NilContextS) GetLogPrefix

func (nc NilContextS) GetLogPrefix() string

type SContext

type SContext struct {
	S string
}

A barebones implementation of a Context.

func (SContext) GetLogPrefix

func (slc SContext) GetLogPrefix() string

type SubContext

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

For nested, hierarchical Contexts.

func (*SubContext) GetLogPrefix

func (slc *SubContext) GetLogPrefix() string

type Underlying

type Underlying interface {
	Debugf(lp string, f string, params ...interface{})
	Infof(lp string, f string, params ...interface{})
	Warnf(lp string, f string, params ...interface{})
	Errorf(lp string, f string, params ...interface{})
}

Implemented by github.com/kentik/ktranslate/pkg/util/logger Don't use this directly.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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