This is an automated email from the ASF dual-hosted git repository.

warren pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit f226f13636a9433eea9ce0e92828ecd2ecb9f148
Author: Mr.An <[email protected]>
AuthorDate: Tue Jun 7 16:30:08 2022 +0800

    [improve]add endpoint debug log
---
 api/api.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/api/api.go b/api/api.go
index 2c664911..0a561428 100644
--- a/api/api.go
+++ b/api/api.go
@@ -19,6 +19,7 @@ package api
 
 import (
        _ "github.com/apache/incubator-devlake/api/docs"
+       "log"
        "time"
 
        "github.com/apache/incubator-devlake/config"
@@ -41,6 +42,12 @@ func CreateApiService() {
        router := gin.Default()
 
        router.GET("/swagger/*any", 
ginSwagger.WrapHandler(swaggerFiles.Handler))
+
+       //endpoint debug log
+       gin.DebugPrintRouteFunc = func(httpMethod, absolutePath, handlerName 
string, nuHandlers int) {
+               log.Printf("endpoint %v %v %v %v\n", httpMethod, absolutePath, 
handlerName, nuHandlers)
+       }
+
        // CORS CONFIG
        router.Use(cors.New(cors.Config{
                AllowOrigins:     []string{"*"},

Reply via email to