fixup! Update documentation.

This commit is contained in:
2025-02-28 18:10:56 +00:00
parent f87a53ec65
commit 98f6c31e9d
16 changed files with 149 additions and 149 deletions
+9 -8
View File
@@ -5,6 +5,7 @@ import (
"github.com/stretchr/testify/assert"
)
func TestInitLogger(t *testing.T) {
// Test with debug mode enabled
logger := InitLogger(true)
@@ -25,10 +26,10 @@ func TestLoggingFunctions(t *testing.T) {
Debug("Debug message", map[string]interface{}{"key": "value"})
Info("Info message", map[string]interface{}{"key": "value"})
Error("Error message", map[string]interface{}{"key": "value"})
// Skip testing Critical as it might call os.Exit
// Critical("Critical message", map[string]interface{}{"key": "value"})
// Test passes if we get here without panicking
assert.True(t, true)
}
@@ -43,10 +44,10 @@ func TestLoggingWithNilLogger(t *testing.T) {
Debug("Debug message", map[string]interface{}{"key": "value"})
Info("Info message", map[string]interface{}{"key": "value"})
Error("Error message", map[string]interface{}{"key": "value"})
// Skip testing Critical as it might call os.Exit
// Critical("Critical message", map[string]interface{}{"key": "value"})
// Test passes if we get here without panicking
assert.True(t, true)
}
@@ -56,15 +57,15 @@ func TestCriticalNilLogger(t *testing.T) {
// Save original logger and restore after test
originalLogger := Logger
defer func() { Logger = originalLogger }()
// Set logger to nil
Logger = nil
// This should not panic
Critical("Critical message", map[string]interface{}{"key": "value"})
// Test passes if we get here without panicking
assert.True(t, true)
}
// Note: We don't test Critical with an actual logger because it calls os.Exit
// Note: We don't test Critical with an actual logger because it calls os.Exit