Skip to content

Commit 2cc911a

Browse files
authored
Export Logger's log level (#70)
1 parent 6ce8b51 commit 2cc911a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

log/logger.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
const (
15-
_logLevelEnv = "JFROG_LOG_LEVEL"
15+
LogLevelEnv = "JFROG_LOG_LEVEL"
1616
)
1717

1818
type Log interface {
@@ -48,7 +48,7 @@ const (
4848
)
4949

5050
func getLogLevel() LevelType {
51-
switch strings.ToUpper(os.Getenv(_logLevelEnv)) {
51+
switch strings.ToUpper(os.Getenv(LogLevelEnv)) {
5252
case "ERROR":
5353
return ERROR
5454
case "WARN":

log/logger_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88
)
99

1010
func SetEnvironmentVariableForLogLevel(t *testing.T, level string) {
11-
assert.NoError(t, os.Setenv(_logLevelEnv, level))
11+
assert.NoError(t, os.Setenv(LogLevelEnv, level))
1212
}
1313

1414
func ResetEnvironmentVariableForLogLevel(t *testing.T) {
15-
assert.NoError(t, os.Unsetenv(_logLevelEnv))
15+
assert.NoError(t, os.Unsetenv(LogLevelEnv))
1616
}
1717

1818
func TestLogger_WithDefaultInfoLogLevel_LogsInfoAndAbove(t *testing.T) {

0 commit comments

Comments
 (0)