Skip to content

Commit bc9e03a

Browse files
committed
Minor Logging Changes
1 parent dce5445 commit bc9e03a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

internals/proxy/middlewares/body.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (data BodyMiddleware) Use() http.Handler {
2727
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
2828
bodyBytes, err := io.ReadAll(req.Body)
2929
if err != nil {
30-
log.Error("Could not read body:", err.Error())
30+
log.Error("Could not read Body: ", err.Error())
3131
http.Error(w, "Bad Request", http.StatusBadRequest)
3232
return
3333
}

internals/proxy/middlewares/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func (data LogMiddleware) Use() http.Handler {
1414
next := data.Next
1515

1616
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
17-
log.Info(req.Method, req.URL.Path, "?", req.URL.RawQuery)
17+
log.Info(req.Method, " ", req.URL.Path, " ", req.URL.RawQuery)
1818

1919
next.ServeHTTP(w, req)
2020
})

internals/proxy/middlewares/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (data TemplateMiddleware) Use() http.Handler {
8181
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
8282
bodyBytes, err := io.ReadAll(req.Body)
8383
if err != nil {
84-
log.Error("Could not read body:", err.Error())
84+
log.Error("Could not read Body: ", err.Error())
8585
http.Error(w, "Bad Request", http.StatusBadRequest)
8686
return
8787
}

utils/logger/logger.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ func getLogLevel(level string) zapcore.Level {
6262
}
6363

6464
func Info(msg ...string) {
65-
_log.Info(strings.Join(msg, " "))
65+
_log.Info(strings.Join(msg, ""))
6666
}
6767

6868
func Debug(msg ...string) {
69-
_log.Debug(strings.Join(msg, " "))
69+
_log.Debug(strings.Join(msg, ""))
7070
}
7171

7272
func Error(msg ...string) {
73-
_log.Error(strings.Join(msg, " "))
73+
_log.Error(strings.Join(msg, ""))
7474
}
7575

7676
func Warn(msg ...string) {
77-
_log.Warn(strings.Join(msg, " "))
77+
_log.Warn(strings.Join(msg, ""))
7878
}
7979

8080

0 commit comments

Comments
 (0)