Files
ProjectOctopus/agent-wdd/utils/PrintUtils.go
zeaslity db3d259a0a Enhance Proxy and Configuration Management
- Implemented comprehensive VMESS proxy installation with dynamic configuration
- Added support for Xray installation and configuration generation
- Introduced hostname normalization with city, architecture, and IP-based naming
- Updated proxy commands to include VMESS and VLESS subcommands
- Improved configuration management with NormalizeConfig method
- Enhanced logging and error handling for proxy-related operations
2025-02-28 23:58:38 +08:00

56 lines
1.1 KiB
Go

package utils
import (
"agent-wdd/log"
"encoding/json"
"fmt"
)
func BeautifulPrint(object interface{}) {
bytes, err := json.MarshalIndent(object, "", " ")
if err != nil {
log.Error("[BeautifulPrint] - json marshal error ! => %v", object)
}
fmt.Println()
fmt.Println(string(bytes))
fmt.Println()
}
func BeautifulPrintToString(object interface{}) string {
bytes, err := json.MarshalIndent(object, "", " ")
if err != nil {
log.Error("[BeautifulPrint] - json marshal error ! => %v", object)
}
return string(bytes)
}
func BeautifulPrintWithTitle(contend any, title string) {
fmt.Println()
fmt.Println(">>>>>>>> " + title + " <<<<<<<<")
bytes, _ := json.MarshalIndent(contend, "", " ")
fmt.Println(string(bytes))
fmt.Println(">>>>>>>> end <<<<<<<<")
}
func BeautifulPrintListWithTitle(contend []string, title string) {
fmt.Println()
fmt.Println(">>>>>>>> " + title + " <<<<<<<<")
for _, line := range contend {
fmt.Println(line)
}
fmt.Println(">>>>>>>> end <<<<<<<<")
}
func SplitLinePrint() {
fmt.Println()
fmt.Println()
fmt.Println()
}