logging

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogKeyModule  = "module"
	LogKeyHeight  = "height"
	LogKeyTxHash  = "tx_hash"
	LogKeyMsgType = "msg_type"
)

Variables

View Source
var DbBlockCount = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Name: "juno_db_total_blocks",
		Help: "Total number of blocks in database.",
	},
	[]string{"total_blocks_in_db"},
)
View Source
var DbLatestHeight = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Name: "juno_db_latest_height",
		Help: "Latest block height in the database.",
	},
	[]string{"db_latest_height"},
)

DbLatestHeight represents the Telemetry counter used to track the last indexed height in the database

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

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

View Source
var StartHeight = prometheus.NewCounter(
	prometheus.CounterOpts{
		Name: "juno_initial_height",
		Help: "Initial parsing height.",
	},
)

StartHeight represents the Telemetry counter used to set the start height of the parsing

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

WorkerCount represents the Telemetry counter used to track the worker count

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

WorkerHeight represents the Telemetry counter used to track the last indexed height 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 *tmctypes.ResultBlock, err error)
	EventsError(module modules.Module, results *tmctypes.ResultBlock, err error)
	TxError(module modules.Module, tx *types.Transaction, err error)
	MsgError(module modules.Module, tx *types.Transaction, msg types.Message, 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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