log

package
v0.0.0-...-e029a57 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLevel

func SetLevel(level zapcore.Level)

Types

type HCLogAdapter

type HCLogAdapter struct {
	// contains filtered or unexported fields
}

HCLogAdapter is an adapter that allows to use a zap.Logger where and hclog.Logger is expected.

func NewHCLogAdapter

func NewHCLogAdapter(wrapped *zap.Logger) *HCLogAdapter

NewHCLogAdapter creates a new adapter, wrapping an underlying zap.Logger inside an implementation that emulates hclog.Logger.

func (*HCLogAdapter) Clone

func (l *HCLogAdapter) Clone() *HCLogAdapter

func (*HCLogAdapter) Debug

func (l *HCLogAdapter) Debug(msg string, args ...interface{})

Emit a message and key/value pairs at the DEBUG level

func (*HCLogAdapter) Error

func (l *HCLogAdapter) Error(msg string, args ...interface{})

Emit a message and key/value pairs at the ERROR level

func (*HCLogAdapter) ImpliedArgs

func (l *HCLogAdapter) ImpliedArgs() []interface{}

ImpliedArgs returns With key/value pairs

func (*HCLogAdapter) Info

func (l *HCLogAdapter) Info(msg string, args ...interface{})

Emit a message and key/value pairs at the INFO level

func (*HCLogAdapter) IsDebug

func (l *HCLogAdapter) IsDebug() bool

func (*HCLogAdapter) IsError

func (l *HCLogAdapter) IsError() bool

func (*HCLogAdapter) IsInfo

func (l *HCLogAdapter) IsInfo() bool

func (*HCLogAdapter) IsTrace

func (l *HCLogAdapter) IsTrace() bool

func (*HCLogAdapter) IsWarn

func (l *HCLogAdapter) IsWarn() bool

func (*HCLogAdapter) Log

func (l *HCLogAdapter) Log(level hclog.Level, msg string, args ...interface{})

// Logger describes the interface that must be implemeted by all loggers.

type Logger interface {
	// Args are alternating key, val pairs
	// keys must be strings
	// vals can be any type, but display is implementation specific
	// Emit a message and key/value pairs at a provided log level

func (*HCLogAdapter) Name

func (l *HCLogAdapter) Name() string

func (*HCLogAdapter) Named

func (l *HCLogAdapter) Named(name string) hclog.Logger

func (*HCLogAdapter) ResetNamed

func (l *HCLogAdapter) ResetNamed(name string) hclog.Logger

func (*HCLogAdapter) SetLevel

func (l *HCLogAdapter) SetLevel(level hclog.Level)

func (*HCLogAdapter) StandardLogger

func (l *HCLogAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger

func (*HCLogAdapter) StandardWriter

func (l *HCLogAdapter) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer

Return a value that conforms to io.Writer, which can be passed into log.SetOutput()

func (*HCLogAdapter) Trace

func (l *HCLogAdapter) Trace(msg string, args ...interface{})

Emit a message and key/value pairs at the TRACE level

func (*HCLogAdapter) Warn

func (l *HCLogAdapter) Warn(msg string, args ...interface{})

Emit a message and key/value pairs at the WARN level

func (*HCLogAdapter) With

func (l *HCLogAdapter) With(args ...interface{}) hclog.Logger

Jump to

Keyboard shortcuts

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