logutils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MPL-2.0 Imports: 13 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileHandlerWithRotation added in v0.35.0

func FileHandlerWithRotation(opts FileOptions, format log.Format) log.Handler

FileHandlerWithRotation instantiates log.Handler with a configured rotation

func NewStdHandler added in v0.35.0

func NewStdHandler(fmtr log.Format) log.Handler

NewStdHandler returns handler that uses logger from golang std lib.

func NewZapAdapter added in v0.35.0

func NewZapAdapter(logger log.Logger, enab zapcore.LevelEnabler) zapcore.Core

NewZapAdapter returns a new zapcore.Core interface which forwards logs to log.Logger.

func NewZapLoggerWithAdapter added in v0.35.0

func NewZapLoggerWithAdapter(logger log.Logger) (*zap.Logger, error)

NewZapLoggerWithAdapter returns a logger forwarding all logs with level info and above.

func OverrideRootLog

func OverrideRootLog(enabled bool, levelStr string, fileOpts FileOptions, terminal bool) error

OverrideRootLog overrides root logger with file handler, if defined, and log level (defaults to INFO).

func OverrideRootLogWithConfig added in v0.35.0

func OverrideRootLogWithConfig(settings LogSettings, colors bool) error

OverrideRootLogWithConfig derives all configuration from params.NodeConfig and configures logger using it.

func OverrideWithStdLogger added in v0.35.0

func OverrideWithStdLogger(logLevel string) error

OverrideWithStdLogger overwrites ethereum's root logger with a logger from golang std lib.

func WakuMessageTimestamp added in v0.179.22

func WakuMessageTimestamp(key string, value *int64) zap.Field

func ZapLogger added in v0.46.0

func ZapLogger() *zap.Logger

ZapLogger creates a custom zap.Logger which will forward logs to status-go logger.

Types

type FileOptions added in v0.35.0

type FileOptions struct {
	// Base name for log file.
	Filename string
	// Size in megabytes.
	MaxSize int
	// Number of rotated log files.
	MaxBackups int
	// If true rotated log files will be gzipped.
	Compress bool
}

FileOptions are all options supported by internal rotation module.

type LogSettings added in v0.83.13

type LogSettings struct {
	Enabled         bool   `json:"Enabled"`
	MobileSystem    bool   `json:"MobileSystem"`
	Level           string `json:"Level"`
	File            string `json:"File"`
	MaxSize         int    `json:"MaxSize"`
	MaxBackups      int    `json:"MaxBackups"`
	CompressRotated bool   `json:"CompressRotated"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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