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 ¶ added in v1.68.18
func (my *DebugLogger) Errorf(format string, v ...any)
func (*DebugLogger) Printf ¶ added in v1.68.18
func (my *DebugLogger) Printf(format string, v ...any)
type DebugLoggerAttr ¶ added in v1.68.15
type DebugLoggerAttr func()
func ColorBlue ¶ added in v1.68.15
func ColorBlue() DebugLoggerAttr
func ColorCyan ¶ added in v1.68.16
func ColorCyan() DebugLoggerAttr
func ColorDefault ¶ added in v1.68.17
func ColorDefault() DebugLoggerAttr
func ColorGreen ¶ added in v1.68.15
func ColorGreen() DebugLoggerAttr
func ColorRed ¶ added in v1.68.15
func ColorRed() DebugLoggerAttr
func ColorYellow ¶ added in v1.68.15
func ColorYellow() DebugLoggerAttr
func Console ¶ added in v1.68.21
func Console() DebugLoggerAttr
func OnlyConsole ¶ added in v1.68.21
func OnlyConsole() DebugLoggerAttr
func OnlyWriteToFile ¶ added in v1.68.21
func OnlyWriteToFile(path string) DebugLoggerAttr
func SetMode ¶ added in v1.68.21
func SetMode(mode OutputMode) DebugLoggerAttr
SetMode 支持 1(Console)、2(WriteToFile)、3(Console+WriteToFile)
func WriteToFile ¶ added in v1.68.21
func WriteToFile(path string) DebugLoggerAttr
type OutputMode ¶ added in v1.68.21
type OutputMode uint8
const ( ModeConsole OutputMode = 1 << iota ModeWriteToFile ModeConsoleAndWriteToFile = ModeConsole | ModeWriteToFile )
Click to show internal directories.
Click to hide internal directories.