mirror of
https://dev.azure.com/schwarzit/schwarzit.stackit-public/_git/audit-go
synced 2026-02-08 00:57:24 +00:00
40 lines
895 B
Go
40 lines
895 B
Go
package log
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
func Test_DefaultLogger(t *testing.T) {
|
|
t.Run("debug", func(t *testing.T) {
|
|
AuditLogger.Debug("debug message")
|
|
})
|
|
|
|
t.Run("debug with error details", func(t *testing.T) {
|
|
AuditLogger.Debug("debug message", errors.New("custom error"))
|
|
})
|
|
|
|
t.Run("info", func(t *testing.T) {
|
|
AuditLogger.Info("info message")
|
|
})
|
|
|
|
t.Run("info with error details", func(t *testing.T) {
|
|
AuditLogger.Info("info message", errors.New("custom error"))
|
|
})
|
|
|
|
t.Run("warn", func(t *testing.T) {
|
|
AuditLogger.Warn("warn message")
|
|
})
|
|
|
|
t.Run("warn with error details", func(t *testing.T) {
|
|
AuditLogger.Warn("warn message", errors.New("custom error"))
|
|
})
|
|
|
|
t.Run("error", func(t *testing.T) {
|
|
AuditLogger.Error("error message")
|
|
})
|
|
|
|
t.Run("error with error details", func(t *testing.T) {
|
|
AuditLogger.Error("error message", errors.New("custom error"))
|
|
})
|
|
}
|