Documentation ¶
Index ¶
- Constants
- func Debug(text string)
- func Error(text string)
- func Fatal(text string)
- func Info(text string)
- func Log(logType string, text string, logLevel ...int)
- func LogFmt(text ...string) string
- func LogWithBool(logType string, text string, isNeeded ...bool)
- func LogWithLevel(logType string, text string, logLevel ...int)
- func Print(textColor ...string)
- func Println(textColor ...string)
- func Success(text string)
- func Test()
- func Trace(text string)
- func Warn(text string)
Constants ¶
View Source
const ( // TimeFormat is timestamp format for log. TimeFormat = "2006/01/02 15:04:05.000" // SuccessIcon is success log indicator. SuccessIcon = "[S]" // SuccessType is key to write success log. SuccessType = "success" // TraceIcon is trace log indicator. TraceIcon = "[T]" // TraceType is key to write trace log. TraceType = "trace" // DebugIcon is debug log indicator. DebugIcon = "[D]" // DebugType is key to write debug log. DebugType = "debug" // InfoIcon is info log indicator. InfoIcon = "[I]" // InfoType is key to write info log. InfoType = "info" // WarnIcon is warning log indicator. WarnIcon = "[W]" // WarnType is key to write warn log. WarnType = "warn" // ErrorIcon is error log indicator. ErrorIcon = "[E]" // ErrorType is key to write error log. ErrorType = "error" // FatalIcon is fatal error log indicator. FatalIcon = "[F]" // FatalType is key to write fatal log. FatalType = "fatal" // LevelZero is no log level. LevelZero = 0 // LevelHigh is log level showing Error and Fatal. LevelHigh = 1 // LevelNormal is log level showing Info, Error, and Fatal. LevelNormal = 2 // LevelDebug is log level showing Debug, Info, Warn, Error, and Fatal. LevelDebug = 3 // LevelComplete is log level showing all type of log. LevelComplete = 4 // DefaultLevel is default log level. DefaultLevel = LevelNormal )
View Source
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" BrightBlack = "\033[90m" BrightRed = "\033[91m" BrightGreen = "\033[92m" BrightYellow = "\033[93m" BrightBlue = "\033[94m" BrightMagenta = "\033[95m" BrightCyan = "\033[96m" BrightWhite = "\033[97m" )
Foreground text colors. The output colors may vary on different OS. Taken from https://en.wikipedia.org/wiki/ANSI_escape_code.
Variables ¶
This section is empty.
Functions ¶
func LogWithBool ¶
LogWithBool is helper function for easier call for all log depends on the boolean (isNeeded). Not writing log by default.
func LogWithLevel ¶
LogWithLevel is helper function for easier call for all log depends on log level. Default is writing Info, Error, and Fatal log.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.