aboutsummaryrefslogtreecommitdiffstats
path: root/modules/web/routing
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-07-26 06:21:09 +0800
committerGitHub <noreply@github.com>2023-07-25 22:21:09 +0000
commit3e4a4f9c67ebc08fed0b4dff90c707ddbc608832 (patch)
tree3049dfa30af122448d5cdfb403e355d0b5e4ffe5 /modules/web/routing
parente62ea96ada9e24aaf103ec700eb7728b597926a7 (diff)
downloadgitea-3e4a4f9c67ebc08fed0b4dff90c707ddbc608832.tar.gz
gitea-3e4a4f9c67ebc08fed0b4dff90c707ddbc608832.zip
Fix incorrect router logger (#26137)
A low-level mistake: * `log.Info` is global `Info` function, which calls "default" logger * `logger.Info` is the for router's logger
Diffstat (limited to 'modules/web/routing')
-rw-r--r--modules/web/routing/logger.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/web/routing/logger.go b/modules/web/routing/logger.go
index 6a4dae66f7..5f3a7592af 100644
--- a/modules/web/routing/logger.go
+++ b/modules/web/routing/logger.go
@@ -89,13 +89,13 @@ func logPrinter(logger log.Logger) func(trigger Event, record *requestRecord) {
if v, ok := record.responseWriter.(types.ResponseStatusProvider); ok {
status = v.WrittenStatus()
}
- 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
}