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


The following commit(s) were added to refs/heads/main by this push:
     new 2cf0be70 Added better debug log format display
2cf0be70 is described below

commit 2cf0be70441568a4fb18de45643f6db10833ff36
Author: Mr.An <[email protected]>
AuthorDate: Sat Jun 11 21:16:15 2022 +0800

    Added better debug log format display
---
 api/api.go | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/api/api.go b/api/api.go
index 0a561428..26443e45 100644
--- a/api/api.go
+++ b/api/api.go
@@ -18,10 +18,11 @@ limitations under the License.
 package api
 
 import (
-       _ "github.com/apache/incubator-devlake/api/docs"
-       "log"
        "time"
 
+       _ "github.com/apache/incubator-devlake/api/docs"
+       "github.com/apache/incubator-devlake/logger"
+
        "github.com/apache/incubator-devlake/config"
        "github.com/gin-contrib/cors"
        "github.com/gin-gonic/gin"
@@ -45,7 +46,7 @@ func CreateApiService() {
 
        //endpoint debug log
        gin.DebugPrintRouteFunc = func(httpMethod, absolutePath, handlerName 
string, nuHandlers int) {
-               log.Printf("endpoint %v %v %v %v\n", httpMethod, absolutePath, 
handlerName, nuHandlers)
+               logger.Global.Printf("endpoint %v %v %v %v", httpMethod, 
absolutePath, handlerName, nuHandlers)
        }
 
        // CORS CONFIG

Reply via email to