stdlib

package
v0.0.0-...-f22496c Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const TypeName = "go2chef.logger.stdlib"

TypeName is the name of this logger plugin

Variables

This section is empty.

Functions

func Loader

func Loader(config map[string]interface{}) (go2chef.Logger, error)

Loader creates an StdlibLogger from a config map

Types

type Config

type Config struct {
	Level     string
	Debugging int
}

Config defines the structure of the configuration for this logger. It's separated in this case since the level spec in the configuration file is a string and the internal representation is numeric.

type Logger

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

Logger represents a logger that just sends output to the default stdlib log library with some level info.

func NewFromLogger

func NewFromLogger(l *log.Logger, level, debug int) *Logger

NewFromLogger creates a new instance of the stdlib logger from an existing log.Logger

func (*Logger) Debugf

func (l *Logger) Debugf(dbg int, fmt string, args ...interface{})

Debugf writes a message at DEBUG level *if* the debug level is at least as high as the level passed by the caller.

func (*Logger) Errorf

func (l *Logger) Errorf(fmt string, args ...interface{})

Errorf writes a message at ERROR level

func (*Logger) Infof

func (l *Logger) Infof(fmt string, args ...interface{})

Infof writes a message at INFO level

func (*Logger) Name

func (l *Logger) Name() string

Name returns the name of this logger instance

func (*Logger) SetDebug

func (l *Logger) SetDebug(dbg int)

SetDebug sets the debugging level threshold

func (*Logger) SetLevel

func (l *Logger) SetLevel(lvl int)

SetLevel sets the overall logging level threshold

func (*Logger) SetName

func (l *Logger) SetName(s string)

SetName sets the name of this logger instance

func (*Logger) Shutdown

func (l *Logger) Shutdown()

Shutdown is a no-op for this logger

func (*Logger) String

func (l *Logger) String() string

func (*Logger) Type

func (l *Logger) Type() string

Type returns the type of this logger instance

func (*Logger) WriteEvent

func (l *Logger) WriteEvent(e *go2chef.Event)

WriteEvent writes a formatted event at INFO level

Jump to

Keyboard shortcuts

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