logplugin

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DebugLineLength = int64(4096)
View Source
var NoDisplay = zapcore.Level(zap.FatalLevel + 10)

Functions

This section is empty.

Types

type BlockStreamer added in v0.6.1

type BlockStreamer interface {
	Run(blockServer *blockstream.Server)
}

type KeepLastLinesLogPlugin added in v0.6.1

type KeepLastLinesLogPlugin struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

KeepLastLinesLogPlugin takes a line and keep the last N lines as requested by the caller.

func NewKeepLastLinesLogPlugin added in v0.6.1

func NewKeepLastLinesLogPlugin(lineCount int, includeDeepMindLines bool) *KeepLastLinesLogPlugin

func (*KeepLastLinesLogPlugin) DebugDeepMind added in v0.6.1

func (p *KeepLastLinesLogPlugin) DebugDeepMind(enabled bool)

func (*KeepLastLinesLogPlugin) LastLines added in v0.6.1

func (p *KeepLastLinesLogPlugin) LastLines() []string

func (*KeepLastLinesLogPlugin) Launch added in v0.6.1

func (p *KeepLastLinesLogPlugin) Launch()

func (*KeepLastLinesLogPlugin) LogLine added in v0.6.1

func (p *KeepLastLinesLogPlugin) LogLine(in string)

func (*KeepLastLinesLogPlugin) Name added in v0.6.1

func (p *KeepLastLinesLogPlugin) Name() string

func (KeepLastLinesLogPlugin) Stop added in v0.6.1

func (p KeepLastLinesLogPlugin) Stop()

type LogPlugin

type LogPlugin interface {
	Name() string
	Launch()
	LogLine(in string)
	//Close(err error)
	Shutdown(err error)
	IsTerminating() bool
	Stop()
}

type LogPluginFunc

type LogPluginFunc func(line string)

func (LogPluginFunc) IsTerminating added in v0.6.1

func (f LogPluginFunc) IsTerminating() bool

func (LogPluginFunc) Launch added in v0.6.1

func (f LogPluginFunc) Launch()

func (LogPluginFunc) LogLine

func (f LogPluginFunc) LogLine(line string)

func (LogPluginFunc) Name added in v0.6.1

func (f LogPluginFunc) Name() string

func (LogPluginFunc) OnTerminated added in v0.6.1

func (f LogPluginFunc) OnTerminated(_ func(error))

func (LogPluginFunc) OnTerminating added in v0.6.1

func (f LogPluginFunc) OnTerminating(_ func(error))

func (LogPluginFunc) Shutdown added in v0.6.1

func (f LogPluginFunc) Shutdown(_ error)

func (LogPluginFunc) Stop added in v0.6.1

func (f LogPluginFunc) Stop()

func (LogPluginFunc) Terminated added in v0.6.1

func (f LogPluginFunc) Terminated() <-chan struct{}

type Shutter added in v0.6.1

type Shutter interface {
	Terminated() <-chan struct{}
	OnTerminating(f func(error))
	OnTerminated(f func(error))
	IsTerminating() bool
	Shutdown(err error)
}

type ToConsoleLogPlugin

type ToConsoleLogPlugin struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

ToConsoleLogPlugin takes a line, and if it's not a DMLOG line or if we are actively debugging deep mind, will print the line to the standard output

func NewToConsoleLogPlugin

func NewToConsoleLogPlugin(debugDeepMind bool) *ToConsoleLogPlugin

func (*ToConsoleLogPlugin) DebugDeepMind

func (p *ToConsoleLogPlugin) DebugDeepMind(enabled bool)

func (*ToConsoleLogPlugin) Launch added in v0.6.1

func (p *ToConsoleLogPlugin) Launch()

func (*ToConsoleLogPlugin) LogLine

func (p *ToConsoleLogPlugin) LogLine(in string)

func (*ToConsoleLogPlugin) Name added in v0.6.1

func (p *ToConsoleLogPlugin) Name() string

func (ToConsoleLogPlugin) Stop added in v0.6.1

func (p ToConsoleLogPlugin) Stop()

type ToZapLogPlugin

type ToZapLogPlugin struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

ToZapLogPlugin takes a line, and if it's not a DMLOG line or if we are actively debugging deep mind, will print the line to received logger instance.

func NewToZapLogPlugin

func NewToZapLogPlugin(debugDeepMind bool, logger *zap.Logger, options ...ToZapLogPluginOption) *ToZapLogPlugin

func (*ToZapLogPlugin) DebugDeepMind

func (p *ToZapLogPlugin) DebugDeepMind(enabled bool)

func (*ToZapLogPlugin) Launch added in v0.6.1

func (p *ToZapLogPlugin) Launch()

func (*ToZapLogPlugin) LogLine

func (p *ToZapLogPlugin) LogLine(in string)

func (*ToZapLogPlugin) Name added in v0.6.1

func (p *ToZapLogPlugin) Name() string

func (ToZapLogPlugin) Stop added in v0.6.1

func (p ToZapLogPlugin) Stop()

type ToZapLogPluginOption added in v0.6.1

type ToZapLogPluginOption interface {
	// contains filtered or unexported methods
}

func ToZapLogPluginLogLevel added in v0.6.1

func ToZapLogPluginLogLevel(extractLevel func(in string) zapcore.Level) ToZapLogPluginOption

ToZapLogPluginLogLevel is the option that defines which function to use to extract the log level from the line.

The received function will be invoked with the actual line to log. The function should then return the log level value to use for this line. If the return value is the special value `NoDisplay` constant (which corresponds to log level `15` which does not exist within zap), the line is actually discarded completely and not logged to the logger.

func ToZapLogPluginTransformer added in v0.6.1

func ToZapLogPluginTransformer(transformer func(in string) string) ToZapLogPluginOption

ToZapLogPluginTransformer is the option that defines which function to use to transform the line before being logged to the logger.

The received function will be invoked with the actual line to log **after** the level have been determined. The function should then return the transformed line. If the return line is the empty string, it is discarded completely.

Jump to

Keyboard shortcuts

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