1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

log support print report_line

This commit is contained in:
xuthus5 2021-01-19 22:33:05 +08:00
parent aa54ed5610
commit e19e797aac

View File

@ -69,7 +69,7 @@ func init() {
conf = getConfig() conf = getConfig()
if conf == nil { if conf == nil {
return os.Exit(1)
} }
logFormatter := &easy.Formatter{ logFormatter := &easy.Formatter{
@ -82,6 +82,11 @@ func init() {
panic(err) panic(err)
} }
// 更加彻底的调试 将在标准输出中打印执行行数
if conf.Debug {
log.SetReportCaller(true)
}
log.AddHook(global.NewLocalHook(w, logFormatter, global.GetLogLevel(conf.LogLevel)...)) log.AddHook(global.NewLocalHook(w, logFormatter, global.GetLogLevel(conf.LogLevel)...))
if !global.PathExists(global.IMAGE_PATH) { if !global.PathExists(global.IMAGE_PATH) {