From b531a2fe7f9193b6594f77ff303ea957394519c7 Mon Sep 17 00:00:00 2001 From: Daniel <33197631+dadav@users.noreply.github.com> Date: Tue, 7 May 2024 17:11:51 +0200 Subject: [PATCH] fix: Print logs to stderr (#107) --- pkg/utils/console_printer.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/utils/console_printer.go b/pkg/utils/console_printer.go index 097f917..232dc92 100644 --- a/pkg/utils/console_printer.go +++ b/pkg/utils/console_printer.go @@ -2,12 +2,16 @@ package utils import ( "fmt" + "os" + "github.com/fatih/color" ) -var rbacToolPrefix = color.New(color.FgBlue).SprintFunc() -var lineMsg = color.New(color.FgHiWhite).SprintFunc() +var ( + rbacToolPrefix = color.New(color.FgBlue).SprintFunc() + lineMsg = color.New(color.FgHiWhite).SprintFunc() +) func ConsolePrinter(msg string) { - fmt.Println(rbacToolPrefix("[RAPID7-INSIGHTCLOUDSEC]"), lineMsg(msg)) + fmt.Fprintln(os.Stderr, rbacToolPrefix("[RAPID7-INSIGHTCLOUDSEC]"), lineMsg(msg)) }