Repos / gorts / 71f24eeeaf
commit 71f24eeeaf8be640ac921f5c36055b654fdc5a5e
Author: Nhân <hi@imnhan.com>
Date: Thu Jun 22 10:21:37 2023 +0700
more readable ipc debug messages
diff --git a/main.go b/main.go
index 74e89a4..48a4a38 100644
--- a/main.go
+++ b/main.go
@@ -13,6 +13,7 @@
"os/exec"
"runtime"
"strconv"
+ "strings"
"time"
"go.imnhan.com/gorts/netstring"
@@ -93,7 +94,7 @@ func startGUI() {
scanner.Split(netstring.SplitFunc)
respond := func(ss ...string) {
- debug := fmt.Sprintf("<-- %v", ss)
+ debug := fmt.Sprintf("<-- %v", strings.Join(ss, ", "))
if len(debug) > 35 {
debug = debug[:35] + "[...]"
}
@@ -104,7 +105,7 @@ func startGUI() {
for scanner.Scan() {
req := netstring.DecodeMultiple(scanner.Text())
- fmt.Printf("--> %v\n", req)
+ fmt.Printf("--> %v\n", strings.Join(req, ", "))
switch req[0] {
case "geticon":
respond(string(gortsPngIcon))