Documentation ¶
Index ¶
Constants ¶
View Source
const ( Reset string = "\033[0m" Red string = "\033[31m" Green string = "\033[32m" Yellow string = "\033[33m" Blue string = "\033[34m" Purple string = "\033[35m" Cyan string = "\033[36m" White string = "\033[37m" BrightRed string = "\033[31;1m" BrightGreen string = "\033[32;1m" BrightYellow string = "\033[33;1m" BrightBlue string = "\033[34;1m" BrightPurple string = "\033[35;1m" BrightCyan string = "\033[36;1m" )
ANSI color codes
View Source
const ( LogErr = "error" LogWarn = "warning" LogInfo = "info" LogDebug = "debug" LogTest = "test" )
Variables ¶
View Source
var ( // LogTest ColorLevelTest = Purple // LogDebug ColorLevelDebug = Green // LogInfo ColorLevelInfo = Blue // LogWarn ColorLevelWarning = Yellow // LogErr ColorLevelError = Red // No level, default switch case opt. ColorNoLevel = Green )
Preset colors for use in the logger's Colorize function
Functions ¶
Types ¶
type Logger ¶
type Logger interface { // Set the standard output SetStd(std *os.File) // Set the standard output for errors SetStdErr(std *os.File) // Write a message Write(t string, message string, args ...any) // Write an error message Error(msg any, args ...any) // Write a warning message Warning(msg string, args ...any) // Write an info message Info(msg string, args ...any) // Write a debug message Debug(msg string, args ...any) // Write a test message Test(msg string, args ...any) }
Standard logger interface. Every logger should implement this interface. To be used by the framework.
Click to show internal directories.
Click to hide internal directories.