chainlink: github.com/smartcontractkit/chainlink/core/logger Index | Files

package logger

import "github.com/smartcontractkit/chainlink/core/logger"

Package logger is used to store details of events in the node. Events can be categorized by Debug, Info, Error, Fatal, and Panic.

Index

Package Files

logger.go logger_unix.go prettyconsole.go

func CreateProductionLogger Uses

func CreateProductionLogger(
    dir string, jsonConsole bool, lvl zapcore.Level, toDisk bool) *zap.Logger

CreateProductionLogger returns a log config for the passed directory with the given LogLevel and customizes stdout for pretty printing.

func Debug Uses

func Debug(args ...interface{})

Debug logs a debug message.

func Debugf Uses

func Debugf(format string, values ...interface{})

Debugf formats and then logs the message.

func Debugw Uses

func Debugw(msg string, keysAndValues ...interface{})

Debugw logs a debug message and any additional given information.

func Error Uses

func Error(args ...interface{})

Error logs an error message.

func ErrorIf Uses

func ErrorIf(err error, optionalMsg ...string)

ErrorIf logs the error if present.

func Errorf Uses

func Errorf(format string, values ...interface{})

Errorf logs a message at the error level using Sprintf.

func Errorw Uses

func Errorw(msg string, keysAndValues ...interface{})

Errorw logs an error message, any additional given information, and includes stack trace.

func Fatal Uses

func Fatal(args ...interface{})

Fatal logs a fatal message then exits the application.

func Fatalf Uses

func Fatalf(format string, values ...interface{})

Fatalf logs a message at the fatal level using Sprintf.

func ISO8601UTC Uses

func ISO8601UTC(t time.Time) string

ISO8601UTC formats given time to ISO8601.

func Info Uses

func Info(args ...interface{})

Info logs an info message.

func Infof Uses

func Infof(format string, values ...interface{})

Infof formats and then logs the message.

func Infow Uses

func Infow(msg string, keysAndValues ...interface{})

Infow logs an info message and any additional given information.

func Panic Uses

func Panic(args ...interface{})

Panic logs a panic message then panics.

func PanicIf Uses

func PanicIf(err error)

PanicIf logs the error if present.

func Panicf Uses

func Panicf(format string, values ...interface{})

Panicf formats and then logs the message before panicking.

func SetLogger Uses

func SetLogger(zl *zap.Logger)

SetLogger sets the internal logger to the given input.

func Sync Uses

func Sync() error

Sync flushes any buffered log entries.

func Warn Uses

func Warn(args ...interface{})

Warn logs a message at the warn level.

func WarnIf Uses

func WarnIf(err error)

WarnIf logs the error if present.

func Warnf Uses

func Warnf(format string, values ...interface{})

Warnf formats and then logs the message as Warn.

func Warnw Uses

func Warnw(msg string, keysAndValues ...interface{})

Warnw logs a debug message and any additional given information.

type Logger Uses

type Logger struct {
    *zap.SugaredLogger
}

Logger holds a field for the logger interface.

func GetLogger Uses

func GetLogger() *Logger

func (*Logger) Write Uses

func (l *Logger) Write(b []byte) (int, error)

Write logs a message at the Info level and returns the length of the given bytes.

type PrettyConsole Uses

type PrettyConsole struct {
    zap.Sink
}

PrettyConsole wraps a Sink (Writer, Syncer, Closer), usually stdout, and formats the incoming json bytes with colors and white space for readability before passing on to the underlying Writer in Sink.

func (PrettyConsole) Write Uses

func (pc PrettyConsole) Write(b []byte) (int, error)

Write reformats the incoming json bytes with colors, newlines and whitespace for better readability in console.

Package logger imports 14 packages (graph). Updated 2020-04-06. Refresh now. Tools for package owners.