Documentation ¶
Index ¶
- Variables
- type BlockStreamer
- type KeepLastLinesLogPlugin
- type LogPlugin
- type LogPluginFunc
- func (f LogPluginFunc) IsTerminating() bool
- func (f LogPluginFunc) Launch()
- func (f LogPluginFunc) LogLine(line string)
- func (f LogPluginFunc) Name() string
- func (f LogPluginFunc) OnTerminated(_ func(error))
- func (f LogPluginFunc) OnTerminating(_ func(error))
- func (f LogPluginFunc) Shutdown(_ error)
- func (f LogPluginFunc) Stop()
- func (f LogPluginFunc) Terminated() <-chan struct{}
- type Shutter
- type ToConsoleLogPlugin
- type ToZapLogPlugin
- type ToZapLogPluginOption
Constants ¶
This section is empty.
Variables ¶
var DebugLineLength = int64(4096)
var NoDisplay = zapcore.Level(zap.FatalLevel + 10)
Functions ¶
This section is empty.
Types ¶
type BlockStreamer ¶
type BlockStreamer interface {
Run(blockServer *blockstream.Server)
}
type KeepLastLinesLogPlugin ¶
KeepLastLinesLogPlugin takes a line and keep the last N lines as requested by the caller.
func NewKeepLastLinesLogPlugin ¶
func NewKeepLastLinesLogPlugin(lineCount int, includeDeepMindLines bool) *KeepLastLinesLogPlugin
func (*KeepLastLinesLogPlugin) DebugDeepMind ¶
func (p *KeepLastLinesLogPlugin) DebugDeepMind(enabled bool)
func (*KeepLastLinesLogPlugin) LastLines ¶
func (p *KeepLastLinesLogPlugin) LastLines() []string
func (*KeepLastLinesLogPlugin) Launch ¶
func (p *KeepLastLinesLogPlugin) Launch()
func (*KeepLastLinesLogPlugin) LogLine ¶
func (p *KeepLastLinesLogPlugin) LogLine(in string)
func (*KeepLastLinesLogPlugin) Name ¶
func (p *KeepLastLinesLogPlugin) Name() string
func (KeepLastLinesLogPlugin) Stop ¶
func (p KeepLastLinesLogPlugin) Stop()
type LogPluginFunc ¶
type LogPluginFunc func(line string)
func (LogPluginFunc) IsTerminating ¶
func (f LogPluginFunc) IsTerminating() bool
func (LogPluginFunc) Launch ¶
func (f LogPluginFunc) Launch()
func (LogPluginFunc) LogLine ¶
func (f LogPluginFunc) LogLine(line string)
func (LogPluginFunc) Name ¶
func (f LogPluginFunc) Name() string
func (LogPluginFunc) OnTerminated ¶
func (f LogPluginFunc) OnTerminated(_ func(error))
func (LogPluginFunc) OnTerminating ¶
func (f LogPluginFunc) OnTerminating(_ func(error))
func (LogPluginFunc) Shutdown ¶
func (f LogPluginFunc) Shutdown(_ error)
func (LogPluginFunc) Stop ¶
func (f LogPluginFunc) Stop()
func (LogPluginFunc) Terminated ¶
func (f LogPluginFunc) Terminated() <-chan struct{}
type ToConsoleLogPlugin ¶
ToConsoleLogPlugin takes a line, and if it's not a FIRE (or 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 ¶
func (p *ToConsoleLogPlugin) Launch()
func (*ToConsoleLogPlugin) LogLine ¶
func (p *ToConsoleLogPlugin) LogLine(in string)
func (*ToConsoleLogPlugin) Name ¶
func (p *ToConsoleLogPlugin) Name() string
func (*ToConsoleLogPlugin) SetSkipBlankLines ¶
func (p *ToConsoleLogPlugin) SetSkipBlankLines(skip bool)
func (ToConsoleLogPlugin) Stop ¶
func (p ToConsoleLogPlugin) Stop()
type ToZapLogPlugin ¶
ToZapLogPlugin takes a line, and if it's not a FIRE (or 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 ¶
func (p *ToZapLogPlugin) Launch()
func (*ToZapLogPlugin) LogLine ¶
func (p *ToZapLogPlugin) LogLine(in string)
func (*ToZapLogPlugin) Name ¶
func (p *ToZapLogPlugin) Name() string
func (ToZapLogPlugin) Stop ¶
func (p ToZapLogPlugin) Stop()
type ToZapLogPluginOption ¶
type ToZapLogPluginOption interface {
// contains filtered or unexported methods
}
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.