1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

logging: several improvements

Former-commit-id: 12538c74a1aa55314c35ac3cf2665646b704851d
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-04-28 01:58:56 +03:00
parent b02706f207
commit 27ca1c93f5
11 changed files with 125 additions and 56 deletions

View File

@@ -2,7 +2,6 @@ package mvc
import (
"fmt"
"os"
"reflect"
"strings"
@@ -337,15 +336,13 @@ func (c *ControllerActivator) handleMany(method, path, funcName string, override
return nil
}
wd, _ := os.Getwd()
for _, r := range routes {
// change the main handler's name and file:line
// in order to respect the controller's and give
// a proper debug/log message.
r.MainHandlerName = fmt.Sprintf("%s.%s", c.fullName, funcName)
if m, ok := c.Type.MethodByName(funcName); ok {
r.SourceFileName, r.SourceLineNumber = context.HandlerFileLineRel(m.Func, wd)
r.SourceFileName, r.SourceLineNumber = context.HandlerFileLineRel(m.Func)
}
}