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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user