Documentation
¶
Index ¶
- Constants
- Variables
- func Error(v ...any)
- func Errorf(format string, v ...any)
- func Fatal(v ...any)
- func Fatalf(format string, v ...any)
- func Print(v ...any)
- func Printf(format string, v ...any)
- type DebugLogger
- type DebugLoggerAttr
- func ColorBlue() DebugLoggerAttr
- func ColorCyan() DebugLoggerAttr
- func ColorDefault() DebugLoggerAttr
- func ColorGreen() DebugLoggerAttr
- func ColorRed() DebugLoggerAttr
- func ColorYellow() DebugLoggerAttr
- func Console() DebugLoggerAttr
- func OnlyConsole() DebugLoggerAttr
- func OnlyWriteToFile(path string) DebugLoggerAttr
- func SetMode(mode OutputMode) DebugLoggerAttr
- func WriteToFile(path string) DebugLoggerAttr
- type OutputMode
Constants ¶
View Source
const ( COLOR_RED = "\033[31m" COLOR_GREEN = "\033[32m" COLOR_YELLOW = "\033[33m" COLOR_BLUE = "\033[34m" COLOR_CYAN = "\033[36m" COLOR_RESET = "\033[0m" )
View Source
const ENV_TAG = "AID_DEBUG_LOG"
Variables ¶
View Source
var Once once
Functions ¶
Types ¶
type DebugLogger ¶
type DebugLogger struct {
// contains filtered or unexported fields
}
func (*DebugLogger) Errorf ¶
func (my *DebugLogger) Errorf(format string, v ...any)
func (*DebugLogger) Printf ¶
func (my *DebugLogger) Printf(format string, v ...any)
type DebugLoggerAttr ¶
type DebugLoggerAttr func()
func ColorBlue ¶
func ColorBlue() DebugLoggerAttr
func ColorCyan ¶
func ColorCyan() DebugLoggerAttr
func ColorDefault ¶
func ColorDefault() DebugLoggerAttr
func ColorGreen ¶
func ColorGreen() DebugLoggerAttr
func ColorRed ¶
func ColorRed() DebugLoggerAttr
func ColorYellow ¶
func ColorYellow() DebugLoggerAttr
func Console ¶
func Console() DebugLoggerAttr
func OnlyConsole ¶
func OnlyConsole() DebugLoggerAttr
func OnlyWriteToFile ¶
func OnlyWriteToFile(path string) DebugLoggerAttr
func SetMode ¶
func SetMode(mode OutputMode) DebugLoggerAttr
SetMode 支持 1(Console)、2(WriteToFile)、3(Console+WriteToFile)
func WriteToFile ¶
func WriteToFile(path string) DebugLoggerAttr
type OutputMode ¶
type OutputMode uint8
const ( ModeConsole OutputMode = 1 << iota ModeWriteToFile ModeConsoleAndWriteToFile = ModeConsole | ModeWriteToFile )
Click to show internal directories.
Click to hide internal directories.