1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-07-09 19:49:29 +08:00
parent d3001524f2
commit 7b21b28b98
2 changed files with 12 additions and 5 deletions

View File

@ -148,7 +148,14 @@ func _dream_check(m *ice.Message, name string) string {
p := path.Join(ice.USR_LOCAL_WORK, name)
if pp := path.Join(p, ice.VAR_LOG_ICE_PID); nfs.Exists(m, pp) {
for i := 0; i < 5; i++ {
if pid := m.Cmdx(nfs.CAT, pp, kit.Dict(ice.MSG_USERROLE, aaa.TECH)); pid != "" && nfs.Exists(m, "/proc/"+pid) {
pid := m.Cmdx(nfs.CAT, pp, kit.Dict(ice.MSG_USERROLE, aaa.TECH))
if pid == "" {
return p
}
if !kit.HasPrefix(m.Cmdx(nfs.CAT, "/proc/"+pid+"/cmdline"), kit.Path("bin/ice.bin"), kit.Path(p, "bin/ice.bin")) {
return p
}
if nfs.Exists(m, "/proc/"+pid) {
m.Info("already exists %v", pid)
} else if gdb.SignalProcess(m, pid) {
m.Info("already exists %v", pid)

View File

@ -52,11 +52,8 @@ func (m *Message) join(arg ...Any) (string, []Any) {
return kit.Join(list, SP), meta
}
func (m *Message) log(level string, str string, arg ...Any) *Message {
if !strings.Contains(Info.Make.Domain, "debug=true") {
return m
}
if m.Option(LOG_DISABLE) == TRUE {
// return m
return m
}
args, traceid := []Any{}, ""
for _, v := range arg {
@ -68,6 +65,9 @@ func (m *Message) log(level string, str string, arg ...Any) *Message {
}
_source := logs.FileLineMeta(3)
kit.If(Info.Log != nil, func() { Info.Log(m, m.FormatPrefix(traceid), level, logs.Format(str, append(args, _source)...)) })
if !strings.Contains(Info.Make.Domain, "debug=true") {
return m
}
prefix, suffix := "", ""
if Info.Colors {
switch level {