From 36257429007855cadeebb7fa1cc824b14418fb29 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Thu, 26 Jan 2023 13:26:43 +0800 Subject: [PATCH] opt inner.js --- base/log/debug.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/base/log/debug.go b/base/log/debug.go index da0bb3f3..9e3b690b 100644 --- a/base/log/debug.go +++ b/base/log/debug.go @@ -2,6 +2,7 @@ package log import ( "strings" + "unicode" ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/ctx" @@ -27,8 +28,6 @@ func init() { ls := strings.SplitN(line, ice.SP, 6) m.Push(mdb.TIME, ls[0]+ice.SP+ls[1]) m.Push(mdb.ID, ls[2]) - m.Push("ship", ls[3]) - i := strings.LastIndex(ls[5], ice.SP) if strings.HasPrefix(ls[5][i+1:], "base") || strings.HasPrefix(ls[5][i+1:], "core") || strings.HasPrefix(ls[5][i+1:], "misc") { m.Push(nfs.PATH, ice.USR_ICEBERGS) @@ -45,6 +44,17 @@ func init() { m.Push(nfs.FILE, "init.go") m.Push(nfs.LINE, "90") } + if ls[4] == "cmds" { + _ls := strings.SplitN(ls[5], ice.SP, 2) + ls[4] = _ls[0] + ls[5] = _ls[1] + if !unicode.IsDigit(rune(ls[5][0])) { + _ls := strings.SplitN(ls[5], ice.SP, 2) + ls[4] += ice.SP + _ls[0] + ls[5] = _ls[1] + } + } + m.Push("ship", ls[3]) m.Push(ctx.ACTION, ls[4]) m.Push(mdb.TEXT, ls[5]) })