Skip to content

Commit

Permalink
Address test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
james03160927 committed Aug 25, 2023
1 parent 971bc19 commit ecfff31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion commands/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
// CreateCli - Create the CLI app with all commands, flags, and usage text configured.
func CreateCli(version string) *cli.App {
app := cli.NewApp()
logging.InitLogger()
_, disableTelemetryFlag := os.LookupEnv("DISABLE_TELEMETRY")
if !disableTelemetryFlag {
ui.WarningMessage("This program sends telemetry to Gruntwork. To disable, set DISABLE_TELEMETRY=true as an environment variable")
Expand Down
11 changes: 6 additions & 5 deletions logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import (
"os"
)

var Logger *logrus.Logger
var Logger = InitLogger()

func InitLogger() {
Logger = logrus.New()
func InitLogger() *logrus.Logger {
logger := logrus.New()

// Set the desired log level (e.g., Debug, Info, Warn, Error, etc.)
Logger.SetLevel(logrus.InfoLevel)
logger.SetLevel(logrus.InfoLevel)

// You can also set the log output (e.g., os.Stdout, a file, etc.)
Logger.SetOutput(os.Stdout)
logger.SetOutput(os.Stdout)
return logger
}

0 comments on commit ecfff31

Please sign in to comment.