Back to godoc.org

Package logplugin

v0.0.2-0...-f788962
Latest Go to latest

The latest major version is .

Published: 5 days ago | License: Apache-2.0 | Module: github.com/dfuse-io/node-manager

Index

Variables

var DebugLineLength = int64(1000)
var NoDisplay = zapcore.Level(zap.FatalLevel + 10)

type BlockStreamer

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

type LogPlugin

type LogPlugin interface {
	LogLine(in string)
	Close(err error)
}

type LogPluginFunc

type LogPluginFunc func(line string)

func (LogPluginFunc) Close

func (f LogPluginFunc) Close(_ error)

func (LogPluginFunc) LogLine

func (f LogPluginFunc) LogLine(line string)

type Shutter

type Shutter interface {
	OnTerminated(f func(error))
	Shutdown(err error)
}

type ToConsoleLogPlugin

type ToConsoleLogPlugin struct {
	// 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, zlogger *zap.Logger) *ToConsoleLogPlugin

func (*ToConsoleLogPlugin) Close

func (p *ToConsoleLogPlugin) Close(_ error)

func (*ToConsoleLogPlugin) DebugDeepMind

func (p *ToConsoleLogPlugin) DebugDeepMind(enabled bool)

func (*ToConsoleLogPlugin) LogLine

func (p *ToConsoleLogPlugin) LogLine(in string)

type ToZapLogPlugin

type ToZapLogPlugin struct {
	// 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) Close

func (p *ToZapLogPlugin) Close(_ error)

func (*ToZapLogPlugin) DebugDeepMind

func (p *ToZapLogPlugin) DebugDeepMind(enabled bool)

func (*ToZapLogPlugin) LastLines

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

func (*ToZapLogPlugin) LogLine

func (p *ToZapLogPlugin) LogLine(in string)

type ToZapLogPluginOption

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

func ToZapLogPluginKeepLastNLine

func ToZapLogPluginKeepLastNLine(count int) ToZapLogPluginOption

ToZapLogPluginKeepLastNLine defines how many of the last line(s) to keep when doing the logging. This option is useful to retrieve a small amount of line seen by the process when an error happens.

func ToZapLogPluginLogLevel

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

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier