logging

package
v0.0.0-...-1f8a15b Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogJsonFlag = cli.BoolFlag{
		Name:  "log.json",
		Usage: "Format console logs with JSON",
	}

	LogConsoleJsonFlag = cli.BoolFlag{
		Name:  "log.console.json",
		Usage: "Format console logs with JSON",
	}

	LogDirJsonFlag = cli.BoolFlag{
		Name:  "log.dir.json",
		Usage: "Format file logs with JSON",
	}

	LogVerbosityFlag = cli.StringFlag{
		Name:  "verbosity",
		Usage: "Set the log level for console logs",
		Value: log.LvlInfo.String(),
	}

	LogConsoleVerbosityFlag = cli.StringFlag{
		Name:  "log.console.verbosity",
		Usage: "Set the log level for console logs",
		Value: log.LvlInfo.String(),
	}
	LogDirDisableFlag = cli.BoolFlag{
		Name:  "log.dir.disable",
		Usage: "disable disk logging",
	}
	LogDirPathFlag = cli.StringFlag{
		Name:  "log.dir.path",
		Usage: "Path to store user and error logs to disk",
	}

	LogDirPrefixFlag = cli.StringFlag{
		Name:  "log.dir.prefix",
		Usage: "The file name prefix for logs stored to disk",
	}

	LogDirVerbosityFlag = cli.StringFlag{
		Name:  "log.dir.verbosity",
		Usage: "Set the log verbosity for logs stored to disk",
		Value: log.LvlInfo.String(),
	}
)

Functions

func SetupLogger

func SetupLogger(filePrefix string) log.Logger

SetupLoggerCmd perform the logging using parametrs specifying by `flag` package, and sets it to the root logger This is the function which is NOT used by Erigon itself, but instead by utility commans

func SetupLoggerCmd

func SetupLoggerCmd(filePrefix string, cmd *cobra.Command) log.Logger

SetupLoggerCmd perform the logging for a cobra command, and sets it to the root logger This is the function which is NOT used by Erigon itself, but instead by some cobra-based commands, for example, rpcdaemon or integration. Note: urfave and cobra are two CLI frameworks/libraries for the same functionalities and it would make sense to choose one over another

func SetupLoggerCtx

func SetupLoggerCtx(filePrefix string, ctx *cli.Context, rootHandler bool) log.Logger

SetupLoggerCtx performs the logging setup according to the parameters containted in the given urfave context. It returns either root logger, if rootHandler argument is set to true, or a newly created logger. This is to ensure gradual transition to the use of non-root logger thoughout the erigon code without a huge change at once. This function which is used in Erigon itself. Note: urfave and cobra are two CLI frameworks/libraries for the same functionalities and it would make sense to choose one over another

Types

This section is empty.

Jump to

Keyboard shortcuts

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