orchard controller: make sure that output goes through the logger (#207)

...which emits JSON on the production for easier processing.
This commit is contained in:
Nikolay Edigaryev
2024-09-17 22:54:43 +04:00
committed by GitHub
parent 979af1f699
commit 1730eaf67c
4 changed files with 79 additions and 61 deletions
+4
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"github.com/cirruslabs/orchard/internal/controller"
"github.com/cirruslabs/orchard/internal/netconstants"
"github.com/gin-gonic/gin"
"github.com/spf13/cobra"
"go.uber.org/zap"
"os"
@@ -55,6 +56,9 @@ func newRunCommand() *cobra.Command {
}
func runController(cmd *cobra.Command, args []string) (err error) {
// Avoid fancy output that doesn't go through the logger
gin.SetMode(gin.ReleaseMode)
// Initialize the logger
zapConfig := zap.NewProductionConfig()
if debug {