logger

package
v0.0.0-...-9c76ea3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: GPL-2.0, GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset  = "\033[0m"
	Purple = "\033[35m"
	Red    = "\033[31m"
	Yellow = "\033[33m"
	White  = "\033[37m"
)

ANSI color codes

Variables

This section is empty.

Functions

func Debug

func Debug(format string, args ...interface{})

Debug logs a debug message

func DisableColors

func DisableColors()

DisableColors disables ANSI color codes

func Err

func Err(format string, args ...interface{})

Err logs an error message

func Fatal

func Fatal(format string, args ...interface{})

Fatal logs a fatal message and exits the program

func Info

func Info(format string, args ...interface{})

Info logs an informational message

func SetIgnoreLevel

func SetIgnoreLevel(ignore []LogLevel)

SetIgnoreLevel sets the log levels to ignore

func SetLevel

func SetLevel(l LogLevel)

SetLevel sets the global log level

func Trace

func Trace(format string, args ...interface{})

Trace logs a trace message

func Warn

func Warn(format string, args ...interface{})

Warn logs a warning message

Types

type LogLevel

type LogLevel int

LogLevel defines the level of logging

const (
	FATAL LogLevel = iota
	ERROR
	WARN
	INFO
	DEBUG
	TRACE
)

Jump to

Keyboard shortcuts

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