From e67f8f847b2455c0e28d3339d755bbfe88272338 Mon Sep 17 00:00:00 2001 From: Norbert Klar Date: Fri, 4 Feb 2022 21:11:07 +0100 Subject: [PATCH] use log package instead of fmt --- main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 9072e54..b963761 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "log" "os" "github.com/gin-gonic/gin" @@ -18,10 +19,8 @@ func init() { router.NoRoute(controller.HandleRoutes) } else { cwd, _ := os.Getwd() - fmt.Println("An error occurred while trying to read Gauguin configuration:") - fmt.Println(config.ConfigError) - fmt.Println("We've tried to read the following configuration file:") - fmt.Println(fmt.Sprintf("%s/gauguin.yaml", cwd)) + log.Printf("error occurred while trying to read Gauguin configuration: %v\n", config.ConfigError) + log.Printf("we've tried to read the following configuration file: %s\n", fmt.Sprintf("%s/gauguin.yaml", cwd)) router.NoRoute(controller.ConfigError) }