1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-07-01 20:42:27 +08:00
parent c18f363085
commit 178a73ae4f
2 changed files with 6 additions and 11 deletions

View File

@ -67,10 +67,8 @@ func init() {
)), )),
), Actions: ice.MergeActions(ice.Actions{ ), Actions: ice.MergeActions(ice.Actions{
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
m.Cmd("", func(value ice.Maps) { m.Cmd("", func(value ice.Maps) { m.Cmd("", aaa.WHITE, LOCALHOST, value[aaa.IP]) })
ice.Info.Host = value[aaa.IP] ice.Info.Host = mdb.Config(m, DOMAIN)
m.Cmd("", aaa.WHITE, LOCALHOST, value[aaa.IP])
})
}}, }},
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) { mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
if mdb.IsSearchPreview(m, arg) && m.Cmd(HOST).Length() > 0 { if mdb.IsSearchPreview(m, arg) && m.Cmd(HOST).Length() > 0 {

11
logs.go
View File

@ -7,7 +7,6 @@ import (
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"os"
"runtime" "runtime"
"strings" "strings"
"time" "time"
@ -53,9 +52,12 @@ func (m *Message) join(arg ...Any) (string, []Any) {
return kit.Join(list, SP), meta return kit.Join(list, SP), meta
} }
func (m *Message) log(level string, str string, arg ...Any) *Message { func (m *Message) log(level string, str string, arg ...Any) *Message {
if m.Option(LOG_DISABLE) == TRUE { if !strings.Contains(Info.Make.Domain, "debug=true") {
return m return m
} }
if m.Option(LOG_DISABLE) == TRUE {
// return m
}
args, traceid := []Any{}, "" args, traceid := []Any{}, ""
for _, v := range arg { for _, v := range arg {
if v, ok := v.(logs.Meta); ok && v.Key == logs.TRACEID { if v, ok := v.(logs.Meta); ok && v.Key == logs.TRACEID {
@ -66,11 +68,6 @@ func (m *Message) log(level string, str string, arg ...Any) *Message {
} }
_source := logs.FileLineMeta(3) _source := logs.FileLineMeta(3)
kit.If(Info.Log != nil, func() { Info.Log(m, m.FormatPrefix(traceid), level, logs.Format(str, append(args, _source)...)) }) kit.If(Info.Log != nil, func() { Info.Log(m, m.FormatPrefix(traceid), level, logs.Format(str, append(args, _source)...)) })
if os.Getenv("TERM") == "" {
if !strings.Contains(Info.Make.Domain, "debug=true") {
return m
}
}
prefix, suffix := "", "" prefix, suffix := "", ""
if Info.Colors { if Info.Colors {
switch level { switch level {