logger

package
v0.0.0-...-ed7d7af Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ENCODER_CONFIG zapcore.EncoderConfig

Functions

func Set

func Set(l Logger)

Types

type Autopilot

type Autopilot struct {
	Log
	HumanReadableBuffer   *bytes.Buffer
	MachineReadableBuffer *bytes.Buffer
}

func NewAutopilot

func NewAutopilot(s ...Settings) *Autopilot

func (*Autopilot) Flush

func (l *Autopilot) Flush()

func (*Autopilot) String

func (l *Autopilot) String() string

func (*Autopilot) ToFile

func (l *Autopilot) ToFile()

type Common

type Common struct {
	Log
}

func NewCommon

func NewCommon(s ...Settings) *Common

type Log

type Log struct {
	Logger *zap.Logger
	Settings
}

func (*Log) Debug

func (l *Log) Debug(msg string, fields ...zap.Field)

func (*Log) Debugf

func (l *Log) Debugf(msg string, args ...interface{})

func (*Log) Error

func (l *Log) Error(msg string, fields ...zap.Field)

func (*Log) Errorf

func (l *Log) Errorf(msg string, args ...interface{})

func (*Log) Info

func (l *Log) Info(msg string, fields ...zap.Field)

func (*Log) Infof

func (l *Log) Infof(msg string, args ...interface{})

func (*Log) Warn

func (l *Log) Warn(msg string, fields ...zap.Field)

func (*Log) Warnf

func (l *Log) Warnf(msg string, args ...interface{})

type LogHelper

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

func NewHelper

func NewHelper(logger Logger) *LogHelper

func (*LogHelper) LogFormatMapIndented

func (h *LogHelper) LogFormatMapIndented(key string, value map[string]string, indentation ...int)

func (*LogHelper) LogJsonLogEntry

func (h *LogHelper) LogJsonLogEntry(l model.LogEntry, indent int) error

func (*LogHelper) LogKeyValueIndented

func (h *LogHelper) LogKeyValueIndented(key string, value string, indentation ...int)

type Logger

type Logger interface {
	Debug(msg string, fields ...zap.Field)
	Debugf(msg string, args ...interface{})
	Info(msg string, fields ...zap.Field)
	Infof(msg string, args ...interface{})
	Warn(msg string, fields ...zap.Field)
	Warnf(msg string, args ...interface{})
	Error(msg string, fields ...zap.Field)
	Errorf(msg string, args ...interface{})
}

func Get

func Get() Logger

type Settings

type Settings struct {
	Level   string
	File    string
	Secrets map[string]string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳