gooseberry: github.com/voicera/gooseberry/log/zap Index | Files

package zap

import "github.com/voicera/gooseberry/log/zap"

Package zap provides a wrapper for https://go.uber.org/zap that implements the log.LeveledLogger interface and adds convenience features to logging with zap.

Index

Package Files

doc.go zap.go

Variables

var (
    // Level is log level.
    Level = zap.DebugLevel

    // DefaultLogger is the default zap logger instance.
    DefaultLogger = newLoggerAdapter(false)
)

func Debug Uses

func Debug(message string, args ...interface{})

Debug logs a debug message. It accepts varargs of alternating key and value parameters.

func Error Uses

func Error(message string, args ...interface{})

Error logs an error message. It accepts varargs of alternating key and value parameters.

func Info Uses

func Info(message string, args ...interface{})

Info logs an informational message. It accepts varargs of alternating key and value parameters.

func IsDebugEnabled Uses

func IsDebugEnabled() bool

IsDebugEnabled checks whether or not debug logging is enabled. Useful to check before logging a message that requires preprocessing.

func Sync Uses

func Sync() error

Sync flushes the Logger.

func Warn Uses

func Warn(message string, args ...interface{})

Warn logs a warning message. It accepts varargs of alternating key and value parameters.

type Logger Uses

type Logger struct {
    *zap.Logger
}

Logger implements log.LeveledLogger.

func (*Logger) Debug Uses

func (adapter *Logger) Debug(message string, args ...interface{})

Debug logs a debug message. It accepts varargs of alternating key and value parameters.

func (*Logger) Error Uses

func (adapter *Logger) Error(message string, args ...interface{})

Error logs an error message. It accepts varargs of alternating key and value parameters.

func (*Logger) Info Uses

func (adapter *Logger) Info(message string, args ...interface{})

Info logs an informational message. It accepts varargs of alternating key and value parameters.

func (*Logger) IsDebugEnabled Uses

func (adapter *Logger) IsDebugEnabled() bool

IsDebugEnabled checks whether or not debug logging is enabled. Useful to check before logging a message that requires preprocessing.

func (*Logger) Warn Uses

func (adapter *Logger) Warn(message string, args ...interface{})

Warn logs a warning message. It accepts varargs of alternating key and value parameters.

Package zap imports 8 packages (graph). Updated 2018-04-02. Refresh now. Tools for package owners.