-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix log-level not working properly (#568)
* Fix log-level not working properly * Address test failure
- Loading branch information
1 parent
6b41a50
commit 6887713
Showing
5 changed files
with
19 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
package logging | ||
|
||
import "github.com/gruntwork-io/go-commons/logging" | ||
import ( | ||
"github.com/sirupsen/logrus" | ||
"os" | ||
) | ||
|
||
// Logger - Global logger variable | ||
var Logger = logging.GetLogger("cloud-nuke", "") | ||
var Logger = InitLogger() | ||
|
||
func InitLogger(name string, version string) { | ||
Logger = logging.GetLogger(name, version) | ||
func InitLogger() *logrus.Logger { | ||
logger := logrus.New() | ||
|
||
// Set the desired log level (e.g., Debug, Info, Warn, Error, etc.) | ||
logger.SetLevel(logrus.InfoLevel) | ||
|
||
// You can also set the log output (e.g., os.Stdout, a file, etc.) | ||
logger.SetOutput(os.Stdout) | ||
return logger | ||
} |