debugLogs

package
v2.9.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 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

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

func (*DebugLogger) Print

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

Print 输出调试日志

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
)

Jump to

Keyboard shortcuts

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