debugLogger

package
v1.69.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

func Error

func Error(v ...any)

func Errorf

func Errorf(format string, v ...any)

func Fatal

func Fatal(v ...any)

func Fatalf

func Fatalf(format string, v ...any)

func Print

func Print(v ...any)

func Printf

func Printf(format string, v ...any)

Types

type DebugLogger

type DebugLogger struct {
	// contains filtered or unexported fields
}

func (*DebugLogger) Error

func (my *DebugLogger) Error(v ...any)

Error 输出错误日志

func (*DebugLogger) Errorf added in v1.68.18

func (my *DebugLogger) Errorf(format string, v ...any)

func (*DebugLogger) Print

func (my *DebugLogger) Print(v ...any)

Print 输出调试日志

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL