1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-09 03:57:19 +00:00

Improve log format (#33814)

This commit is contained in:
wxiaoguang
2025-03-08 21:47:11 +08:00
committed by GitHub
parent 6422f05a4e
commit 4ed71eb754
13 changed files with 120 additions and 74 deletions

View File

@ -41,7 +41,7 @@ func (h *EngineHook) AfterProcess(c *contexts.ContextHook) error {
// 8 is the amount of skips passed to runtime.Caller, so that in the log the correct function
// is being displayed (the function that ultimately wants to execute the query in the code)
// instead of the function of the slow query hook being called.
h.Logger.Log(8, log.WARN, "[Slow SQL Query] %s %v - %v", c.SQL, c.Args, c.ExecuteTime)
h.Logger.Log(8, &log.Event{Level: log.WARN}, "[Slow SQL Query] %s %v - %v", c.SQL, c.Args, c.ExecuteTime)
}
return nil
}