log

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorReset        = "\033[0m " // extra space HERE in order to not write spaces to each of log entries
	ColorRed          = "\033[31m"
	ColorGreen        = "\033[32m"
	ColorYellow       = "\033[33m"
	ColorBlue         = "\033[34m"
	ColorPurple       = "\033[35m"
	ColorCyan         = "\033[36m"
	ColorGray         = "\033[37m"
	ColorWhite        = "\033[97m"
	ColorBrightRed    = "\033[91m"
	ColorBrightGreen  = "\033[92m"
	ColorBrightYellow = "\033[93m"
	ColorBrightBlue   = "\033[94m"
	ColorBrightPurple = "\033[95m"
	ColorBrightCyan   = "\033[96m"
	ColorBgRed        = "\033[41m"
	ColorBgDarkRed    = "\033[48;5;88m"
)

ANSI color codes

Variables

This section is empty.

Functions

func CreatePerCall

func CreatePerCall(tp LoggerType, format string, v ...any) string

func Customf added in v0.1.5

func Customf(levelName string, format string, v ...any)

func Debug

func Debug(format string)

func Debugf added in v0.1.3

func Debugf(format string, v ...any)

func Error

func Error(format string)

func Errorf added in v0.1.3

func Errorf(format string, v ...any)

func Fatal

func Fatal(format string)

func Fatalf added in v0.1.3

func Fatalf(format string, v ...any)

func Info

func Info(format string)

func Infof added in v0.1.3

func Infof(format string, v ...any)

func Notice

func Notice(format string)

func Noticef added in v0.1.3

func Noticef(format string, v ...any)

func RegisterCustom added in v0.1.5

func RegisterCustom(name string, colorCode string)

func SetDepth added in v0.1.5

func SetDepth(depth int)

SetDepth - Set depth to look for file. If 0 no filename will be listed in log

func SetFlags added in v0.1.5

func SetFlags(value int)

SetFlags - provide log.L* flags here.

func SetOutput added in v0.1.5

func SetOutput(output io.Writer)

SetOutput - Set output for logs

func SetType added in v0.1.5

func SetType(t LoggerType)

SetType - Set type of log to look for

func Streamf added in v0.1.5

func Streamf(format string, v ...any)

Streamf - an ability to stream message

func Success

func Success(format string)

func Successf added in v0.1.3

func Successf(format string, v ...any)

func Warn

func Warn(format string)

func Warnf added in v0.1.3

func Warnf(format string, v ...any)

Types

type AllLog

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

AllLog - represents logger and it's interface with params

type Logger

type Logger interface {
	Debug(format string)
	Info(format string)
	Warn(format string)
	Error(format string)
	Success(format string)
	Notice(format string)

	Debugf(format string, v ...any)
	Infof(format string, v ...any)
	Warnf(format string, v ...any)
	Errorf(format string, v ...any)
	Successf(format string, v ...any)
	Noticef(format string, v ...any)
}

type LoggerType

type LoggerType int

LoggerType - for validation

const (
	LoggerDebug LoggerType = iota
	LoggerInfo
	LoggerWarn
	LoggerError
	LoggerFatal
	LoggerSuccess
	LoggerNotice
)

Level

func (LoggerType) IsValid

func (lT LoggerType) IsValid() bool

Jump to

Keyboard shortcuts

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