logger

package
v0.0.0-...-537fcec Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugw

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

Debugw logs a debug message and any additional given information.

func Error

func Error(args ...interface{})

Error logs an error message using Sprint.

func Errorw

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

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

func Fatal

func Fatal(args ...interface{})

Fatal logs a fatal message then exits the application using Sprint.

func Info

func Info(args ...interface{})

Info logs an info message using Sprint.

func Infow

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

Infow logs an info message and any additional given information.

func Panic

func Panic(args ...interface{})

Panic logs a panic message then panics using Sprint.

func Panicf

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

Panicf formats and then logs the message before panicking.

func Reconfigure

func Reconfigure(dir string, lvl zapcore.Level)

Reconfigure creates a new log file at the configured directory with the given LogLevel.

func SetLogger

func SetLogger(l *Logger)

SetLogger sets the internal logger to the given input.

func Sync

func Sync() error

Sync flushes any buffered log entries.

func Warn

func Warn(args ...interface{})

Warn logs a message at the warn level using Sprint.

func WarnIf

func WarnIf(err error)

WarnIf logs the error if present.

func Warnw

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

Warnw logs a debug message and any additional given information.

Types

type Logger

type Logger struct {
	*zap.SugaredLogger
}

Logger holds a field for the logger interface.

func NewLogger

func NewLogger(zl *zap.Logger) *Logger

NewLogger returns the logger updated with the given Logger.

func (*Logger) Write

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

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

Jump to

Keyboard shortcuts

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