MCPcopy Index your code
hub / github.com/TruthHun/BookStack / RegisterLogger

Function RegisterLogger

commands/command.go:110–137  ·  view source on GitHub ↗

RegisterLogger 注册日志

(log string)

Source from the content-addressed store, hash-verified

108
109// RegisterLogger 注册日志
110func RegisterLogger(log string) {
111
112 logs.SetLogFuncCall(true)
113 logs.SetLogger("console")
114 logs.EnableFuncCallDepth(true)
115 logs.Async()
116
117 logPath := filepath.Join(log, "log.log")
118
119 if _, err := os.Stat(logPath); os.IsNotExist(err) {
120
121 os.MkdirAll(log, 0777)
122
123 if f, err := os.Create(logPath); err == nil {
124 f.Close()
125 config := make(map[string]interface{}, 1)
126
127 config["filename"] = logPath
128
129 b, _ := json.Marshal(config)
130
131 beego.SetLogger("file", string(b))
132 }
133 }
134
135 beego.SetLogFuncCall(true)
136 beego.BeeLogger.Async()
137}
138
139// RunCommand 注册orm命令行工具
140func RegisterCommand() {

Callers 1

ResolveCommandFunction · 0.85

Calls 2

stringFunction · 0.85
CreateMethod · 0.45

Tested by

no test coverage detected