logger

package module
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

README

Logger

Go logging module.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr struct {
	Key   string
	Value string
}

func BoolAttr

func BoolAttr(key string, value bool) Attr

func Float32Attr

func Float32Attr(key string, value float32) Attr

func Float64Attr

func Float64Attr(key string, value float64) Attr

func Int8Attr

func Int8Attr(key string, value int8) Attr

func Int16Attr

func Int16Attr(key string, value int16) Attr

func Int32Attr

func Int32Attr(key string, value int32) Attr

func Int64Attr

func Int64Attr(key string, value int64) Attr

func IntAttr

func IntAttr(key string, value int) Attr

func StringAttr

func StringAttr(key string, value string) Attr

type GotifyOptions

type GotifyOptions struct {
	URL         string
	Token       string
	ServiceName string
}

type LogLevel

type LogLevel int
const (
	LogLevelDebug LogLevel = iota
	LogLevelInfo
	LogLevelWarn
	LogLevelError
	LogLevelUnknown
)

func ParseLogLevel

func ParseLogLevel(level string) (LogLevel, error)

func (LogLevel) MarshalJSON

func (l LogLevel) MarshalJSON() ([]byte, error)

func (LogLevel) MarshalYAML

func (l LogLevel) MarshalYAML() ([]byte, error)

func (LogLevel) String

func (l LogLevel) String() string

func (*LogLevel) UnmarshalJSON

func (l *LogLevel) UnmarshalJSON(data []byte) error

func (*LogLevel) UnmarshalYAML

func (l *LogLevel) UnmarshalYAML(data []byte) error

type Logger

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

func New

func New(w io.Writer, name string, logLevel LogLevel) *Logger

func NewWithGotify

func NewWithGotify(w io.Writer, name string, logLevel LogLevel, opts GotifyOptions) *Logger

func (*Logger) Debug

func (l *Logger) Debug(msg string)

func (*Logger) Error

func (l *Logger) Error(err error, msg string)

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) Warn

func (l *Logger) Warn(msg string)

func (*Logger) WithBool

func (l *Logger) WithBool(key string, value bool) *Logger

func (*Logger) WithFloat32

func (l *Logger) WithFloat32(key string, value float32) *Logger

func (*Logger) WithFloat64

func (l *Logger) WithFloat64(key string, value float64) *Logger

func (*Logger) WithGroup

func (l *Logger) WithGroup(name string, attrs ...Attr) *Logger

func (*Logger) WithInt

func (l *Logger) WithInt(key string, value int) *Logger

func (*Logger) WithInt8

func (l *Logger) WithInt8(key string, value int8) *Logger

func (*Logger) WithInt16

func (l *Logger) WithInt16(key string, value int16) *Logger

func (*Logger) WithInt32

func (l *Logger) WithInt32(key string, value int32) *Logger

func (*Logger) WithInt64

func (l *Logger) WithInt64(key string, value int64) *Logger

func (*Logger) WithString

func (l *Logger) WithString(key, value string) *Logger

func (*Logger) WithUInt

func (l *Logger) WithUInt(key string, value uint) *Logger

func (*Logger) WithUInt8

func (l *Logger) WithUInt8(key string, value uint8) *Logger

func (*Logger) WithUInt16

func (l *Logger) WithUInt16(key string, value uint16) *Logger

func (*Logger) WithUInt32

func (l *Logger) WithUInt32(key string, value uint32) *Logger

func (*Logger) WithUInt64

func (l *Logger) WithUInt64(key string, value uint64) *Logger

Jump to

Keyboard shortcuts

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