@@ -10,6 +10,7 @@ import (
1010 "codacy/cli-v2/tools"
1111 "codacy/cli-v2/tools/lizard"
1212 reviveTool "codacy/cli-v2/tools/revive"
13+ "codacy/cli-v2/utils/logger"
1314 "encoding/json"
1415 "fmt"
1516 "log"
@@ -21,6 +22,7 @@ import (
2122
2223 codacyclient "codacy/cli-v2/codacy-client"
2324
25+ "github.com/sirupsen/logrus"
2426 "github.com/spf13/cobra"
2527 "gopkg.in/yaml.v3"
2628)
@@ -301,12 +303,19 @@ func checkIfConfigExistsAndIsNeeded(toolName string, cliLocalMode bool) error {
301303 return fmt .Errorf ("failed to create config file for tool %s: %w" , toolName , err )
302304 }
303305 } else {
304- fmt .Printf ("Config file not found for tool %s: %s and no API token provided\n " , toolName , toolConfigPath )
306+ logger .Warn ("Config file not found for tool" , logrus.Fields {
307+ "tool" : toolName ,
308+ "toolConfigPath" : toolConfigPath ,
309+ "message" : "No API token provided" ,
310+ })
305311 }
306312 } else if err != nil {
307313 return fmt .Errorf ("error checking config file for tool %s: %w" , toolName , err )
308314 } else {
309- fmt .Printf ("Config file found for %s: %s\n " , toolName , toolConfigPath )
315+ logger .Info ("Config file found for tool" , logrus.Fields {
316+ "tool" : toolName ,
317+ "toolConfigPath" : toolConfigPath ,
318+ })
310319 }
311320 return nil
312321}
0 commit comments