logging

package
v0.0.0-...-dfb9311 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 11 Imported by: 14

Documentation

Overview

Package logging sets up logging for gomel.

It also contains decoders for translating logfile into human readable form.

Index

Constants

View Source
const (
	// Frequent events
	UnitCreated           = "A"
	CreatorNotReady       = "B"
	CreatorProcessingUnit = "C"
	SendingUnitToCreator  = "D"
	AddPreunits           = "E"
	PreunitReady          = "F"
	UnitAdded             = "G"
	ReadyToAdd            = "H"
	DuplicatedUnits       = "I"
	DuplicatedPreunits    = "J"
	UnknownParents        = "K"
	NewTimingUnit         = "L"
	OwnUnitOrdered        = "M"
	LinearOrderExtended   = "N"
	UnitOrdered           = "O"
	SentUnit              = "P"
	PreunitReceived       = "Q"
	SyncStarted           = "R"
	SyncCompleted         = "S"
	GetInfo               = "T"
	SendInfo              = "U"
	GetUnits              = "V"
	SendUnits             = "W"
	PreblockProduced      = "Y"
	// Rare events
	NewEpoch              = "a"
	EpochEnd              = "b"
	SkippingEpoch         = "c"
	ServiceStarted        = "d"
	ServiceStopped        = "e"
	GotWTK                = "f"
	CreatorFinished       = "g"
	ForkDetected          = "h"
	MissingRandomBytes    = "i"
	InvalidControlHash    = "j"
	InvalidEpochProof     = "k"
	InvalidCreator        = "l"
	FreezedParent         = "m"
	FutureLastTiming      = "n"
	UnableToRetrieveEpoch = "o"
	RequestOverload       = "p"
)

Shortcuts for event types. Any event that happens multiple times should have a single character representation.

View Source
const (
	Sent              = "A"
	Recv              = "B"
	Creator           = "C"
	ID                = "D"
	Epoch             = "E"
	ControlHash       = "F"
	Height            = "H"
	ISID              = "I"
	WTKShareProviders = "J"
	WTKThreshold      = "K"
	LogLevel          = "L"
	Message           = "M"
	Size              = "N"
	OSID              = "O"
	PID               = "P"
	Level             = "Q"
	Round             = "R"
	Service           = "S"
	Time              = "T"
)

Field names.

View Source
const (
	CreatorService int = iota
	OrderService
	AdderService
	ExtenderService
	GossipService
	FetchService
	MCService
	RMCService
	AlertService
	NetworkService
)

Service types.

View Source
const Genesis = "genesis"

Genesis was better with Phil Collins.

Variables

This section is empty.

Functions

func AddingErrors

func AddingErrors(errors []error, size int, log zerolog.Logger)

AddingErrors logs information about errors from AddPreunits to provided logger. size argument is needed to know how many preunits were added in case everything went fine and errors is nil.

func NewDecoder

func NewDecoder(writer io.Writer) io.Writer

NewDecoder creates a decoder that writes to the given writer. Decoder implements io.Writer that takes []bytes with a single log event in JSON and writes it in human readable form.

func NewLogger

func NewLogger(conf config.Config) (zerolog.Logger, error)

NewLogger creates a new zerolog logger based on the given configuration values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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