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, lvl zapcore.Level) *zap.Logger
- func CreateTestLogger() *zap.Logger
- func Debug(args ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func Error(args ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatal(args ...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 Warnw(msg string, keysAndValues ...interface{})
- type Logger
- type PrettyConsole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProductionLogger ¶
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 Debugw ¶
func Debugw(msg string, keysAndValues ...interface{})
Debugw logs a debug message and any additional given information.
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 Infof ¶
func Infof(format string, values ...interface{})
Infof formats and then logs the message before panicking.
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.