progresslog

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: ISC Imports: 7 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 log.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 *types.SerializedBlock)

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.

func (*BlockProgressLogger) LogBlockHeightByParent

func (b *BlockProgressLogger) LogBlockHeightByParent(block, parent *types.SerializedBlock)

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.

func (*BlockProgressLogger) SetLastLogTime

func (b *BlockProgressLogger) SetLastLogTime(time time.Time)

Jump to

Keyboard shortcuts

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