helpers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

func NewLogger

func NewLogger(logger *logrus.Logger) *Logger

func (*Logger) Debug

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

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

func (*Logger) Error

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

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

func (*Logger) ImpliedArgs

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

ImpliedArgs returns With key/value pairs

func (*Logger) Info

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

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

func (*Logger) IsDebug

func (l *Logger) IsDebug() bool

Indicate if DEBUG logs would be emitted. This and the other Is* guards

func (*Logger) IsError

func (l *Logger) IsError() bool

Indicate if ERROR logs would be emitted. This and the other Is* guards

func (*Logger) IsInfo

func (l *Logger) IsInfo() bool

Indicate if INFO logs would be emitted. This and the other Is* guards

func (*Logger) IsTrace

func (l *Logger) IsTrace() bool

Indicate if TRACE logs would be emitted. This and the other Is* guards are used to elide expensive logging code based on the current level.

func (*Logger) IsWarn

func (l *Logger) IsWarn() bool

Indicate if WARN logs would be emitted. This and the other Is* guards

func (*Logger) Log

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

func (*Logger) Name

func (l *Logger) Name() string

Returns the Name of the logger

func (*Logger) Named

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

Create a logger that will prepend the name string on the front of all messages. If the logger already has a name, the new value will be appended to the current name. That way, a major subsystem can use this to decorate all it's own logs without losing context.

func (*Logger) ResetNamed

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

Create a logger that will prepend the name string on the front of all messages. This sets the name of the logger to the value directly, unlike Named which honor the current name as well.

func (*Logger) SetLevel

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

Updates the level. This should affect all related loggers as well, unless they were created with IndependentLevels. If an implementation cannot update the level on the fly, it should no-op.

func (*Logger) StandardLogger

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

Return a value that conforms to the stdlib log.Logger interface

func (*Logger) StandardWriter

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

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

func (*Logger) Trace

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

func (*Logger) Warn

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

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

func (*Logger) With

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

Creates a sublogger that will always have the given key/value pairs

Jump to

Keyboard shortcuts

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