mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-30 09:41:11 -05:00
Backport #26137 by @wxiaoguang A low-level mistake: * `log.Info` is global `Info` function, which calls "default" logger * `logger.Info` is the for router's logger Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
5992365fc1
commit
782b137682
1 changed files with 3 additions and 3 deletions
|
@ -89,13 +89,13 @@ func logPrinter(logger log.Logger) func(trigger Event, record *requestRecord) {
|
||||||
if v, ok := record.responseWriter.(context.ResponseWriter); ok {
|
if v, ok := record.responseWriter.(context.ResponseWriter); ok {
|
||||||
status = v.Status()
|
status = v.Status()
|
||||||
}
|
}
|
||||||
logf := log.Info
|
logf := logger.Info
|
||||||
if strings.HasPrefix(req.RequestURI, "/assets/") {
|
if strings.HasPrefix(req.RequestURI, "/assets/") {
|
||||||
logf = log.Trace
|
logf = logger.Trace
|
||||||
}
|
}
|
||||||
message := completedMessage
|
message := completedMessage
|
||||||
if isUnknownHandler {
|
if isUnknownHandler {
|
||||||
logf = log.Error
|
logf = logger.Error
|
||||||
message = unknownHandlerMessage
|
message = unknownHandlerMessage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue