로그 변경

This commit is contained in:
2023-09-21 13:44:39 +09:00
parent 49a3722a7e
commit 2cec794483
2 changed files with 9 additions and 6 deletions

View File

@ -652,7 +652,8 @@ func MakeHttpRequestForLogging(r *http.Request) *http.Request {
type apiFuncType func(http.ResponseWriter, *http.Request)
type HttpApiHandler struct {
methods map[string]apiFuncType
methods map[string]apiFuncType
originalReceiverName string
}
func MakeHttpApiHandler[T any](receiver *T, receiverName string) HttpApiHandler {
@ -696,7 +697,8 @@ func MakeHttpApiHandler[T any](receiver *T, receiverName string) HttpApiHandler
}
return HttpApiHandler{
methods: methods,
methods: methods,
originalReceiverName: tp.Elem().Name(),
}
}
@ -736,7 +738,8 @@ func (hc *HttpApiBroker) AddHandler(receiver HttpApiHandler) {
}
for k, v := range receiver.methods {
logger.Println("http api registered :", k)
ab := strings.Split(k, ".")
logger.Printf("http api registered : %s.%s -> %s\n", receiver.originalReceiverName, ab[1], k)
hc.methods_dup[k] = append(hc.methods_dup[k], v)
if len(hc.methods_dup[k]) > 1 {