Documentation
¶
Index ¶
- Constants
- func CreatePerCall(tp LoggerType, format string, v ...any) string
- func Customf(levelName string, format string, v ...any)
- func Debug(format string)
- func Debugf(format string, v ...any)
- func Error(format string)
- func Errorf(format string, v ...any)
- func Fatal(format string)
- func Fatalf(format string, v ...any)
- func Info(format string)
- func Infof(format string, v ...any)
- func Notice(format string)
- func Noticef(format string, v ...any)
- func RegisterCustom(name string, colorCode string)
- func SetDepth(depth int)
- func SetFlags(value int)
- func SetOutput(output io.Writer)
- func SetType(t LoggerType)
- func Streamf(format string, v ...any)
- func Success(format string)
- func Successf(format string, v ...any)
- func Warn(format string)
- func Warnf(format string, v ...any)
- type AllLog
- type Logger
- type LoggerType
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 RegisterCustom ¶ added in v0.1.5
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
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
Click to show internal directories.
Click to hide internal directories.