更新工作区配置,删除不再使用的Cloudflare相关文件,优化日志输出格式,增强主机信息收集功能,调整代码结构以提高可维护性。
This commit is contained in:
@@ -8,6 +8,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
DebugMode = true
|
||||
)
|
||||
|
||||
const (
|
||||
colorReset = "\033[0m"
|
||||
colorRed = "\033[31m"
|
||||
@@ -16,15 +20,10 @@ const (
|
||||
colorBlue = "\033[34m"
|
||||
)
|
||||
|
||||
func main() {
|
||||
Debug("Debug message: %s", "connection established")
|
||||
Info("System %s", "started successfully")
|
||||
Warning("Disk space at %d%%", 85)
|
||||
Error("Failed to %s", "load config")
|
||||
}
|
||||
|
||||
func Debug(format string, args ...interface{}) {
|
||||
log("DEBUG", colorBlue, format, args...)
|
||||
if DebugMode {
|
||||
log("DEBUG", colorBlue, format, args...)
|
||||
}
|
||||
}
|
||||
|
||||
func Info(format string, args ...interface{}) {
|
||||
|
||||
Reference in New Issue
Block a user