logging

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package logging defines the Logger interface which is used by the module system. It also includes functions for setting the global log level and a per-package log level.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(levelStr string)

SetLogLevel sets the global log level.

func SetPackageLogLevel

func SetPackageLogLevel(packageName, levelStr string)

SetPackageLogLevel sets a log level for a package, overriding the global level.

Types

type Logger

type Logger interface {
	DPanic(args ...interface{})
	DPanicf(template string, args ...interface{})
	Debug(args ...interface{})
	Debugf(template string, args ...interface{})
	Error(args ...interface{})
	Errorf(template string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(template string, args ...interface{})
	Info(args ...interface{})
	Infof(template string, args ...interface{})
	Panic(args ...interface{})
	Panicf(template string, args ...interface{})
	Warn(args ...interface{})
	Warnf(template string, args ...interface{})
}

Logger is the logging interface used by consensus. It is based on zap.SugaredLogger

func New

func New(name string) Logger

New returns a new logger for stderr with the given name.

func NewWithDest

func NewWithDest(dest io.Writer, name string) Logger

NewWithDest returns a new logger for the given destination with the given name.

Jump to

Keyboard shortcuts

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