logging

package
v1.12.7 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MPL-2.0 Imports: 8 Imported by: 87

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseLogLevel added in v1.12.3

func ParseLogLevel(logLevel string) (log.Level, error)

ParseLogLevel returns the hclog.Level that corresponds with the provided level string. This differs hclog.LevelFromString in that it supports additional level strings.

func Setup added in v1.12.3

func Setup(config LogConfig, w io.Writer) (log.InterceptLogger, error)

Setup creates a new logger with the specified configuration and writer

func TranslateLoggerLevel added in v1.12.3

func TranslateLoggerLevel(logger log.Logger) (string, error)

TranslateLoggerLevel returns the string that corresponds with logging level of the hclog.Logger.

Types

type LogConfig added in v1.12.3

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

LogConfig should be used to supply configuration when creating a new Vault logger

func NewLogConfig added in v1.12.3

func NewLogConfig(name string, logLevel log.Level, logFormat LogFormat, logFilePath string) LogConfig

func (LogConfig) IsFormatJson added in v1.12.3

func (c LogConfig) IsFormatJson() bool

type LogFile added in v1.12.3

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

func NewLogFile added in v1.12.3

func NewLogFile(logPath string, fileName string) *LogFile

func (*LogFile) Write added in v1.12.3

func (l *LogFile) Write(b []byte) (n int, err error)

Write is used to implement io.Writer

type LogFormat added in v1.12.3

type LogFormat int
const (
	UnspecifiedFormat LogFormat = iota
	StandardFormat
	JSONFormat
)

func ParseLogFormat added in v1.12.3

func ParseLogFormat(format string) (LogFormat, error)

ParseLogFormat parses the log format from the provided string.

func (LogFormat) String added in v1.12.3

func (lf LogFormat) String() string

Stringer implementation

Jump to

Keyboard shortcuts

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