logger

package
v0.0.0-...-f318275 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(cfg Config) error

Init initializes the logger with the given configuration

func IsInitialized

func IsInitialized() bool

IsInitialized returns whether the logger has been initialized

Types

type Config

type Config struct {
	Environment string
	TimeFormat  string
	Output      string
	Level       string
	Path        string
	FilePerms   os.FileMode
}

Config holds logger configuration

type LogEvent

type LogEvent interface {
	Str(key string, value string) LogEvent
	Int(key string, value int) LogEvent
	Bool(key string, value bool) LogEvent
	Float64(key string, value float64) LogEvent
	Err(err error) LogEvent
	Interface(key string, value interface{}) LogEvent
	Time(key string, value time.Time) LogEvent
	Dur(key string, value time.Duration) LogEvent
	Msg(msg string)
	Msgf(format string, v ...interface{})
}

LogEvent represents a logging event that can be chained

func Debug

func Debug() LogEvent

Global functions for logging

func Error

func Error() LogEvent

func Fatal

func Fatal() LogEvent

func Info

func Info() LogEvent

func Warn

func Warn() LogEvent

Jump to

Keyboard shortcuts

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