fix: server logs output

This commit is contained in:
Guillaume cornet committed 2023-04-19 14:29:11 +02:00
1 parent f52e917364
commit b46b1b9036
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -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
View File
@@ -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"
@@ -12,6 +13,8 @@ type Server struct {
}
func NewServer() *Server {
gin.DefaultWriter = color.Output
gin.DefaultErrorWriter = color.Error
s := &Server{
router: gin.Default(),
}