Skip to content

Commit

Permalink
Fix incorrect router logger (go-gitea#26137)
Browse files Browse the repository at this point in the history
A low-level mistake:

* `log.Info` is global `Info` function, which calls "default" logger
* `logger.Info` is the for router's logger
  • Loading branch information
wxiaoguang authored and GiteaBot committed Jul 25, 2023
1 parent 5992365 commit fb14539
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/web/routing/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ func logPrinter(logger log.Logger) func(trigger Event, record *requestRecord) {
if v, ok := record.responseWriter.(context.ResponseWriter); ok {
status = v.Status()
}
logf := log.Info
logf := logger.Info
if strings.HasPrefix(req.RequestURI, "/assets/") {
logf = log.Trace
logf = logger.Trace
}
message := completedMessage
if isUnknownHandler {
logf = log.Error
logf = logger.Error
message = unknownHandlerMessage
}

Expand Down

0 comments on commit fb14539

Please sign in to comment.