logging

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHcLogAdapter added in v0.0.9

func NewHcLogAdapter(logger *zerolog.Logger, name string) hclog.Logger

NewHcLogAdapter creates a new hclog.Logger that wraps a zerolog.Logger.

func NewLogger

func NewLogger(ctx context.Context, cfg LoggerConfig) zerolog.Logger

NewLogger creates a new logger with the given configuration.

func ToMap added in v0.0.9

func ToMap(keyValues []any) map[string]any

Types

type HcLogAdapter added in v0.0.9

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

func (*HcLogAdapter) Debug added in v0.0.9

func (h *HcLogAdapter) Debug(msg string, args ...any)

func (*HcLogAdapter) Error added in v0.0.9

func (h *HcLogAdapter) Error(msg string, args ...any)

func (*HcLogAdapter) GetLevel added in v0.0.9

func (h *HcLogAdapter) GetLevel() hclog.Level

func (*HcLogAdapter) ImpliedArgs added in v0.0.9

func (h *HcLogAdapter) ImpliedArgs() []any

func (*HcLogAdapter) Info added in v0.0.9

func (h *HcLogAdapter) Info(msg string, args ...any)

func (*HcLogAdapter) IsDebug added in v0.0.9

func (h *HcLogAdapter) IsDebug() bool

func (*HcLogAdapter) IsError added in v0.0.9

func (h *HcLogAdapter) IsError() bool

func (*HcLogAdapter) IsInfo added in v0.0.9

func (h *HcLogAdapter) IsInfo() bool

func (*HcLogAdapter) IsTrace added in v0.0.9

func (h *HcLogAdapter) IsTrace() bool

func (*HcLogAdapter) IsWarn added in v0.0.9

func (h *HcLogAdapter) IsWarn() bool

func (*HcLogAdapter) Log added in v0.0.9

func (h *HcLogAdapter) Log(level hclog.Level, msg string, args ...any)

func (*HcLogAdapter) Name added in v0.0.9

func (h *HcLogAdapter) Name() string

func (*HcLogAdapter) Named added in v0.0.9

func (h *HcLogAdapter) Named(name string) hclog.Logger

func (*HcLogAdapter) ResetNamed added in v0.0.9

func (h *HcLogAdapter) ResetNamed(_ string) hclog.Logger

func (*HcLogAdapter) SetLevel added in v0.0.9

func (h *HcLogAdapter) SetLevel(level hclog.Level)

func (*HcLogAdapter) StandardLogger added in v0.0.9

func (h *HcLogAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger

func (*HcLogAdapter) StandardWriter added in v0.0.9

func (h *HcLogAdapter) StandardWriter(_ *hclog.StandardLoggerOptions) io.Writer

func (*HcLogAdapter) Trace added in v0.0.9

func (h *HcLogAdapter) Trace(msg string, args ...any)

func (*HcLogAdapter) Warn added in v0.0.9

func (h *HcLogAdapter) Warn(msg string, args ...any)

func (*HcLogAdapter) With added in v0.0.9

func (h *HcLogAdapter) With(args ...any) hclog.Logger

type LoggerConfig added in v0.0.5

type LoggerConfig struct {
	Output            []config.LogOutput
	TimeFormat        string
	Level             zerolog.Level
	NoColor           bool
	ConsoleTimeFormat string

	// (R)Syslog configuration.
	RSyslogNetwork string
	RSyslogAddress string
	SyslogPriority syslog.Priority

	// File output configuration.
	FileName   string
	MaxSize    int
	MaxBackups int
	MaxAge     int
	Compress   bool
	LocalTime  bool

	// the output of config.Console log will be written to this writer, if it is nil os.Stdout will be used.
	ConsoleOut io.Writer

	// group name
	Name string
}

Jump to

Keyboard shortcuts

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