progresslog

package
v0.0.0-...-139b6cb Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockProgressLogger

type BlockProgressLogger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

BlockProgressLogger provides periodic logging for other services in order to show users progress of certain "actions" involving some or all current blocks. Ex: syncing to best chain, indexing all blocks, etc.

func NewBlockProgressLogger

func NewBlockProgressLogger(progressMessage string, logger slog.Logger) *BlockProgressLogger

NewBlockProgressLogger returns a new block progress logger. The progress message is templated as follows:

{progressAction} {numProcessed} {blocks|block} in the last {timePeriod}
({numTxs}, height {lastBlockHeight}, {lastBlockTimeStamp})

func (*BlockProgressLogger) LogBlockHeight

func (b *BlockProgressLogger) LogBlockHeight(block, parent *wire.MsgBlock)

LogBlockHeight logs a new block height as an information message to show progress to the user. In order to prevent spam, it limits logging to one message every 10 seconds with duration and totals included.

Jump to

Keyboard shortcuts

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