logging

package
v0.0.0-...-2adbdf0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogKeyModule          = "module"
	LogKeySlot            = "slot"
	LogKeyTxSignature     = "tx_signature"
	LogKeyProgram         = "program"
	LogKeyInstructionType = "instruction_type"
)

Variables

View Source
var ErrorCount = prometheus.NewCounter(
	prometheus.CounterOpts{
		Name: "soljuno_error_count",
		Help: "Total number of errors emitted.",
	},
)

ErrorCount represents the Telemetry counter used to track the number of errors emitted

View Source
var StartSlot = prometheus.NewCounter(
	prometheus.CounterOpts{
		Name: "soljuno_initial_slot",
		Help: "Initial parsing slot.",
	},
)

StartSlot represents the Telemetry counter used to set the start slot of the parsing

View Source
var WorkerCount = prometheus.NewCounter(
	prometheus.CounterOpts{
		Name: "soljuno_worker_count",
		Help: "Number of active workers.",
	},
)

WorkerCount represents the Telemetry counter used to track the worker count

View Source
var WorkerSlot = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Name: "soljuno_last_indexed_slot",
		Help: "Height of the last indexed block.",
	},
	[]string{"worker_index"},
)

WorkerSlot represents the Telemetry counter used to track the last indexed slot for each worker

Functions

This section is empty.

Types

type Logger

type Logger interface {
	SetLogLevel(level string) error
	SetLogFormat(format string) error

	Info(msg string, keyvals ...interface{})
	Debug(msg string, keyvals ...interface{})
	Error(msg string, keyvals ...interface{})

	GenesisError(module modules.Module, err error)
	BlockError(module modules.Module, block types.Block, err error)
	TxError(module modules.Module, tx types.Tx, err error)
	InstructionError(module modules.Module, tx types.Tx, instruction types.Instruction, err error)
}

Logger defines a function that takes an error and logs it.

func DefaultLogger

func DefaultLogger() Logger

DefaultLogger allows to build a new defaultLogger instance

Jump to

Keyboard shortcuts

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