feat: init audit logger with default logger (#2369)

This commit is contained in:
Benjamin Eder 2023-03-12 19:34:54 +01:00
parent 1a5b999545
commit 935259387a
No known key found for this signature in database
GPG Key ID: 21B6BE3EC42C7B29
2 changed files with 29 additions and 0 deletions

13
audit/audit.go Normal file
View File

@ -0,0 +1,13 @@
package audit
import "log"
var auditLogger *log.Logger
func init() {
setupAuditLogger()
}
func setupAuditLogger() {
auditLogger = log.Default()
}

16
audit/audit_test.go Normal file
View File

@ -0,0 +1,16 @@
package audit
import (
"log"
"testing"
)
func TestSetupAuditLogger(t *testing.T) {
auditLogger = nil
setupAuditLogger()
if auditLogger != log.Default() {
t.Error("Audit logger isn't set to the default logger!")
}
}