logger

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger contains all logic to record validator output and benchmark a Rosetta Server.

func NewLogger

func NewLogger(
	logDir string,
	logBlocks bool,
	logTransactions bool,
	logBalanceChanges bool,
	logReconciliation bool,
) *Logger

NewLogger constructs a new Logger.

func (*Logger) BalanceStream

func (l *Logger) BalanceStream(
	ctx context.Context,
	balanceChanges []*storage.BalanceChange,
) error

BalanceStream writes a slice of storage.BalanceChanges to the balanceStreamFile.

func (*Logger) BlockStream

func (l *Logger) BlockStream(
	ctx context.Context,
	block *types.Block,
	orphan bool,
) error

BlockStream writes the next processed block to the end of the blockStreamFile output file.

func (*Logger) ReconcileFailureStream

func (l *Logger) ReconcileFailureStream(
	ctx context.Context,
	reconciliationType string,
	account *types.AccountIdentifier,
	currency *types.Currency,
	difference string,
	block *types.BlockIdentifier,
) error

ReconcileFailureStream logs all reconciliation checks performed during syncing.

func (*Logger) ReconcileSuccessStream

func (l *Logger) ReconcileSuccessStream(
	ctx context.Context,
	reconciliationType string,
	account *types.AccountIdentifier,
	balance *types.Amount,
	block *types.BlockIdentifier,
) error

ReconcileSuccessStream logs all reconciliation checks performed during syncing.

func (*Logger) TransactionStream

func (l *Logger) TransactionStream(
	ctx context.Context,
	block *types.Block,
	verb string,
) error

TransactionStream writes the next processed block's transactions to the end of the transactionStreamFile.

Jump to

Keyboard shortcuts

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