...
1 package audit
2
3 import (
4 "github.com/go-logr/logr"
5
6 "edge-infra.dev/pkg/lib/fog"
7 )
8
9 type Sink struct {
10
11 log logr.Logger
12
13 clientName string
14 }
15
16
17
18
19 func New(actor string) *Sink {
20 return &Sink{
21 log: fog.New(),
22 clientName: actor,
23 }
24 }
25
26
27 func (s Sink) Log(eventType string, keysAndValues ...interface{}) {
28 s.log.WithName(s.clientName).WithValues("log_class", "audit", "log_type", "edge-agent", "event-type", eventType).Info("edge agent audit logging", keysAndValues...)
29 }
30
View as plain text