Skip to content

Commit be25f8b

Browse files
committed
reduce logs to debug
1 parent 2e652fc commit be25f8b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pkg/filter/filter.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,20 @@ func (f *Filter) ShouldSendEvent(e event.Event) bool {
8383
func (f *Filter) shouldSendEventResource(e event.Event) bool {
8484
// For Event resources, only send warning events and only create events
8585
if e.Reason != "Created" {
86-
logrus.Infof("Filtering out Event resource - reason: %s (only 'Created' events are sent)", e.Reason)
86+
logrus.Debugf("Filtering out Event resource - reason: %s (only 'Created' events are sent)", e.Reason)
8787
return false
8888
}
8989

9090
// Check if it's a warning event
9191
switch obj := e.Obj.(type) {
9292
case *api_v1.Event:
9393
if obj.Type != api_v1.EventTypeWarning {
94-
logrus.Infof("Filtering out Event resource - type: %s (only Warning events are sent)", obj.Type)
94+
logrus.Debugf("Filtering out Event resource - type: %s (only Warning events are sent)", obj.Type)
9595
return false
9696
}
9797
case *events_v1.Event:
9898
if obj.Type != api_v1.EventTypeWarning {
99-
logrus.Infof("Filtering out Event resource - type: %s (only Warning events are sent)", obj.Type)
99+
logrus.Debugf("Filtering out Event resource - type: %s (only Warning events are sent)", obj.Type)
100100
return false
101101
}
102102
default:
@@ -131,19 +131,19 @@ func (f *Filter) shouldSendJobEvent(e event.Event) bool {
131131

132132
// Check if spec changed
133133
if !reflect.DeepEqual(job.Spec, oldJob.Spec) {
134-
logrus.Infof("Job %s spec changed, sending update event", job.Name)
134+
logrus.Debugf("Job %s spec changed, sending update event", job.Name)
135135
return true
136136
}
137137

138138
// Check if job failed
139139
for _, condition := range job.Status.Conditions {
140140
if condition.Type == batch_v1.JobFailed && condition.Status == api_v1.ConditionTrue {
141-
logrus.Infof("Job %s failed, sending update event", job.Name)
141+
logrus.Debugf("Job %s failed, sending update event", job.Name)
142142
return true
143143
}
144144
}
145145

146-
logrus.Infof("Filtering out Job update event - no spec change or failure detected")
146+
logrus.Debugf("Filtering out Job update event - no spec change or failure detected")
147147
return false
148148
}
149149

@@ -174,35 +174,35 @@ func (f *Filter) shouldSendPodEvent(e event.Event) bool {
174174

175175
// Check if spec changed
176176
if !reflect.DeepEqual(pod.Spec, oldPod.Spec) {
177-
logrus.Infof("Pod %s spec changed, sending update event", pod.Name)
177+
logrus.Debugf("Pod %s spec changed, sending update event", pod.Name)
178178
return true
179179
}
180180

181181
// Check for container restarts
182182
if f.hasContainerRestarted(pod) {
183-
logrus.Infof("Pod %s has container restarts, sending update event", pod.Name)
183+
logrus.Debugf("Pod %s has container restarts, sending update event", pod.Name)
184184
return true
185185
}
186186

187187
// Check for ImagePullBackOff
188188
if f.hasImagePullBackOff(pod) {
189-
logrus.Infof("Pod %s has ImagePullBackOff, sending update event", pod.Name)
189+
logrus.Debugf("Pod %s has ImagePullBackOff, sending update event", pod.Name)
190190
return true
191191
}
192192

193193
// Check if pod is evicted
194194
if f.isPodEvicted(pod) {
195-
logrus.Infof("Pod %s is evicted, sending update event", pod.Name)
195+
logrus.Debugf("Pod %s is evicted, sending update event", pod.Name)
196196
return true
197197
}
198198

199199
// Check for OOMKilled
200200
if f.hasOOMKilled(pod) {
201-
logrus.Infof("Pod %s has OOMKilled container, sending update event", pod.Name)
201+
logrus.Debugf("Pod %s has OOMKilled container, sending update event", pod.Name)
202202
return true
203203
}
204204

205-
logrus.Infof("Filtering out Pod update event - no significant changes detected")
205+
logrus.Debugf("Filtering out Pod update event - no significant changes detected")
206206
return false
207207
}
208208

pkg/handlers/cloudevent/cloudevent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (m *CloudEvent) Init(c *config.Config) error {
9595
func (m *CloudEvent) Handle(e event.Event) {
9696
// Apply filtering if enabled
9797
if !m.Filter.ShouldSendEvent(e) {
98-
logrus.Infof("Event filtered out - Kind: %s, Reason: %s, Name: %s", e.Kind, e.Reason, e.Name)
98+
logrus.Debugf("Event filtered out - Kind: %s, Reason: %s, Name: %s", e.Kind, e.Reason, e.Name)
9999
return
100100
}
101101

0 commit comments

Comments
 (0)