Skip to content

Commit

Permalink
call func
Browse files Browse the repository at this point in the history
  • Loading branch information
Sianao committed Nov 25, 2024
1 parent c14eeb0 commit 8976209
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion handler/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func NewHandler(route *mux.Router) http.HandlerFunc {
}
service.DefaultLogFormatter(
service.LogFormatterParams{StatusCode: 404, ClientIP: v[0], Method: r.Method, Path: r.URL.Path})
http.NotFound(w, r)
return
}
//去除掉host方便进入路由匹配
Expand Down
4 changes: 2 additions & 2 deletions service/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (p *LogFormatterParams) IsOutputColor() bool {
}

// defaultLogFormatter is the default log format function Logger middleware uses.
var DefaultLogFormatter = func(param LogFormatterParams) string {
var DefaultLogFormatter = func(param LogFormatterParams) {
var statusColor, methodColor, resetColor string
if param.IsOutputColor() {
statusColor = param.StatusCodeColor()
Expand All @@ -132,7 +132,7 @@ var DefaultLogFormatter = func(param LogFormatterParams) string {
if param.Latency > time.Minute {
param.Latency = param.Latency.Truncate(time.Second)
}
return fmt.Sprintf("[GitProxy] |%s %3d %s| %13v | %15s |%s %-7s %s %#v\n%s",
fmt.Printf("[GitProxy] |%s %3d %s| %13v | %15s |%s %-7s %s %#v\n%s",
statusColor, param.StatusCode, resetColor,
param.Latency,
param.ClientIP,
Expand Down

0 comments on commit 8976209

Please sign in to comment.