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 ¶
- func CreateProductionLogger(dir string, jsonConsole bool, lvl zapcore.Level, toDisk bool) *zap.Logger
- func CreateTestLogger(lvl zapcore.Level) *zap.Logger
- func Debug(args ...interface{})
- func Debugf(format string, values ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func Error(args ...interface{})
- func ErrorIf(err error)
- func Errorf(format string, values ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, values ...interface{})
- func Info(args ...interface{})
- func Infof(format string, values ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func Panic(args ...interface{})
- func PanicIf(err error)
- func Panicf(format string, values ...interface{})
- func SetLogger(zl *zap.Logger)
- func Sync() error
- func Warn(args ...interface{})
- func WarnIf(err error)
- func Warnf(format string, values ...interface{})
- func Warnw(msg string, keysAndValues ...interface{})
- type Logger
- type PrettyConsole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProductionLogger ¶
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 CreateTestLogger ¶
CreateTestLogger creates a logger that directs output to PrettyConsole configured for test output.
func Debugf ¶
func Debugf(format string, values ...interface{})
Debugf formats and then logs the message.
func Debugw ¶
func Debugw(msg string, keysAndValues ...interface{})
Debugw logs a debug message and any additional given information.
func Errorf ¶
func Errorf(format string, values ...interface{})
Errorf logs a message at the error level using Sprintf.
func Errorw ¶
func Errorw(msg string, keysAndValues ...interface{})
Errorw logs an error message, any additional given information, and includes stack trace.
func Fatalf ¶
func Fatalf(format string, values ...interface{})
Fatalf logs a message at the fatal level using Sprintf.
func Infof ¶
func Infof(format string, values ...interface{})
Infof formats and then logs the message.
func Infow ¶
func Infow(msg string, keysAndValues ...interface{})
Infow logs an info message and any additional given information.
func Panicf ¶
func Panicf(format string, values ...interface{})
Panicf formats and then logs the message before panicking.
Types ¶
type Logger ¶
type Logger struct {
*zap.SugaredLogger
}
Logger holds a field for the logger interface.
type PrettyConsole ¶
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.