Skip to content

Commit

Permalink
fix: server logs output
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume cornet authored and Guillaume cornet committed Apr 19, 2023
1 parent f52e917 commit b46b1b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ func Execute() {
}

func exitWithError(err error) {
fmt.Fprintf(color.Output, "%s\n", color.RedString(err.Error()))
fmt.Fprintf(color.Error, "%s\n", color.RedString(err.Error()))
os.Exit(1)
}
3 changes: 3 additions & 0 deletions web/v2/api/server/server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package server

import (
"github.com/fatih/color"
"github.com/gin-gonic/gin"
"github.com/sundowndev/phoneinfoga/v2/web/v2/api"
"github.com/sundowndev/phoneinfoga/v2/web/v2/api/handlers"
Expand All @@ -12,6 +13,8 @@ type Server struct {
}

func NewServer() *Server {
gin.DefaultWriter = color.Output
gin.DefaultErrorWriter = color.Error
s := &Server{
router: gin.Default(),
}
Expand Down

0 comments on commit b46b1b9

Please sign in to comment.