Skip to content

Commit

Permalink
Export Logger's log level (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
omerzi authored Jul 18, 2024
1 parent 6ce8b51 commit 2cc911a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const (
_logLevelEnv = "JFROG_LOG_LEVEL"
LogLevelEnv = "JFROG_LOG_LEVEL"
)

type Log interface {
Expand Down Expand Up @@ -48,7 +48,7 @@ const (
)

func getLogLevel() LevelType {
switch strings.ToUpper(os.Getenv(_logLevelEnv)) {
switch strings.ToUpper(os.Getenv(LogLevelEnv)) {
case "ERROR":
return ERROR
case "WARN":
Expand Down
4 changes: 2 additions & 2 deletions log/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
)

func SetEnvironmentVariableForLogLevel(t *testing.T, level string) {
assert.NoError(t, os.Setenv(_logLevelEnv, level))
assert.NoError(t, os.Setenv(LogLevelEnv, level))
}

func ResetEnvironmentVariableForLogLevel(t *testing.T) {
assert.NoError(t, os.Unsetenv(_logLevelEnv))
assert.NoError(t, os.Unsetenv(LogLevelEnv))
}

func TestLogger_WithDefaultInfoLogLevel_LogsInfoAndAbove(t *testing.T) {
Expand Down

0 comments on commit 2cc911a

Please sign in to comment.