From 6828e6397a80ee8e970b89b1b2f56a9604eebf9f Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Thu, 18 Nov 2021 14:50:57 +0800 Subject: [PATCH] docs: add log --- gterm.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gterm.go b/gterm.go index 1246dca..b04213f 100644 --- a/gterm.go +++ b/gterm.go @@ -158,12 +158,13 @@ func (g *GTerm) WS(w http.ResponseWriter, r *http.Request) { if base != "ws" && base != "." && base != "/" { base = strings.Trim(base, "/") param, _ := xorencrypt.Decrypt(base, g.Salt) - l.Info("starting cmd => ", l.M(param, klog.FgHiGreen)) req := &NewCmdRequest{} err := json.Unmarshal([]byte(param), req) if err != nil { + l.ErrorF(klog.H{"base": base, "decrypt": param}, err) cmd = g.defaultCmd() } else { + l.Info("starting cmd => ", l.M(fmt.Sprintf("%+v", req), klog.FgHiGreen)) cmd = exec.Command(req.Cmd, req.Args...) cmd.Env = req.Envs cmd.Dir = req.Dir