Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions logger/console_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestConsoleLoggerWithEnvLevel(t *testing.T) {
}

for _, tt := range tests {
os.Setenv("SM_LOG_LEVEL", tt.level)
os.Setenv("AGENTUITY_LOG_LEVEL", tt.level)
logger := NewConsoleLogger().(*consoleLogger)

output := captureOutput(func() {
Expand All @@ -122,7 +122,7 @@ func TestConsoleLoggerWithEnvLevel(t *testing.T) {
for _, shouldNotContain := range tt.shouldNotContain {
assert.NotContains(t, output, shouldNotContain)
}
os.Unsetenv("SM_LOG_LEVEL")
os.Unsetenv("AGENTUITY_LOG_LEVEL")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well that's a good catch...

}
}

Expand Down
4 changes: 2 additions & 2 deletions logger/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const (
LevelNone
)

// GetLevelFrom env will look at the environment var `SM_LOG_LEVEL` and convert it into the appropriate LogLevel
// GetLevelFromEnv will look at the environment var `AGENTUITY_LOG_LEVEL` and convert it into the appropriate LogLevel
func GetLevelFromEnv() LogLevel {
s := os.Getenv("SM_LOG_LEVEL")
s := os.Getenv("AGENTUITY_LOG_LEVEL")
switch strings.ToLower(s) { // Convert the string to lowercase to make it case-insensitive
case "trace":
return LevelTrace
Expand Down
1 change: 0 additions & 1 deletion logger/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ type JSONLogEntry struct {
Metadata map[string]interface{} `json:"metadata,omitempty"`
// Logs Explorer allows filtering and display of this as `jsonPayload.component`.
Component string `json:"component,omitempty"`
logLevel LogLevel

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was unused so i killed it

}

// String renders an entry structure to the JSON format expected by Cloud Logging.
Expand Down
4 changes: 2 additions & 2 deletions logger/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestJSONLoggerWithEnvLevel(t *testing.T) {
}

for _, tt := range tests {
os.Setenv("SM_LOG_LEVEL", tt.level)
os.Setenv("AGENTUITY_LOG_LEVEL", tt.level)
logger := NewJSONLogger().(*jsonLogger)

output := captureOutput(func() {
Expand All @@ -154,6 +154,6 @@ func TestJSONLoggerWithEnvLevel(t *testing.T) {
for _, shouldNotContain := range tt.shouldNotContain {
assert.NotContains(t, output, shouldNotContain)
}
os.Unsetenv("SM_LOG_LEVEL")
os.Unsetenv("AGENTUITY_LOG_LEVEL")
}
}