Documentation ¶
Index ¶
- func NewHcLogAdapter(logger *zerolog.Logger, name string) hclog.Logger
- func NewLogger(ctx context.Context, cfg LoggerConfig) zerolog.Logger
- func ToMap(keyValues []any) map[string]any
- type HcLogAdapter
- func (h *HcLogAdapter) Debug(msg string, args ...any)
- func (h *HcLogAdapter) Error(msg string, args ...any)
- func (h *HcLogAdapter) GetLevel() hclog.Level
- func (h *HcLogAdapter) ImpliedArgs() []any
- func (h *HcLogAdapter) Info(msg string, args ...any)
- func (h *HcLogAdapter) IsDebug() bool
- func (h *HcLogAdapter) IsError() bool
- func (h *HcLogAdapter) IsInfo() bool
- func (h *HcLogAdapter) IsTrace() bool
- func (h *HcLogAdapter) IsWarn() bool
- func (h *HcLogAdapter) Log(level hclog.Level, msg string, args ...any)
- func (h *HcLogAdapter) Name() string
- func (h *HcLogAdapter) Named(name string) hclog.Logger
- func (h *HcLogAdapter) ResetNamed(_ string) hclog.Logger
- func (h *HcLogAdapter) SetLevel(level hclog.Level)
- func (h *HcLogAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger
- func (h *HcLogAdapter) StandardWriter(_ *hclog.StandardLoggerOptions) io.Writer
- func (h *HcLogAdapter) Trace(msg string, args ...any)
- func (h *HcLogAdapter) Warn(msg string, args ...any)
- func (h *HcLogAdapter) With(args ...any) hclog.Logger
- type LoggerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHcLogAdapter ¶ added in v0.0.9
NewHcLogAdapter creates a new hclog.Logger that wraps a zerolog.Logger.
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 }
Click to show internal directories.
Click to hide internal directories.