zap

package
v0.0.0-...-dc23390 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

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

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

Functions

func Debug

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

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

func Error

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

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

func Info

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

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

func IsDebugEnabled

func IsDebugEnabled() bool

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

func Sync

func Sync() error

Sync flushes the Logger.

func Warn

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

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

Types

type Logger

type Logger struct {
	*zap.Logger
}

Logger implements log.LeveledLogger.

func (*Logger) Debug

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

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

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

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

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

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

Jump to

Keyboard shortcuts

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