Skip to content

Commit 3d548ee

Browse files
committed
improve logging levels
Signed-off-by: Shivam Sandbhor <[email protected]>
1 parent 3595a61 commit 3d548ee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

custom.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ func (c *customBouncer) Add(decision *models.Decision) error {
5252
if err != nil {
5353
return err
5454
}
55-
log.Printf("custom [%s] : add ban on %s for %s sec (%s)", c.path, *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario)
55+
log.Debugf("custom [%s] : add ban on %s for %s sec (%s)", c.path, *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario)
5656
str, err := serializeDecision(decision)
5757
if err != nil {
5858
log.Warningf("serialize: %s", err)
5959
}
6060
cmd := exec.Command(c.path, "add", *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario, str)
6161
if out, err := cmd.CombinedOutput(); err != nil {
62-
log.Infof("Error in 'add' command (%s): %v --> %s", cmd.String(), err, string(out))
62+
log.Errorf("Error in 'add' command (%s): %v --> %s", cmd.String(), err, string(out))
6363
}
6464
c.newDecisionValueSet[decisionToDecisionKey(decision)] = struct{}{}
6565
return nil
@@ -77,10 +77,10 @@ func (c *customBouncer) Delete(decision *models.Decision) error {
7777
if err != nil {
7878
log.Warningf("serialize: %s", err)
7979
}
80-
log.Printf("custom [%s] : del ban on %s for %s sec (%s)", c.path, *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario)
80+
log.Debugf("custom [%s] : del ban on %s for %s sec (%s)", c.path, *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario)
8181
cmd := exec.Command(c.path, "del", *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario, str)
8282
if out, err := cmd.CombinedOutput(); err != nil {
83-
log.Infof("Error in 'del' command (%s): %v --> %s", cmd.String(), err, string(out))
83+
log.Errorf("Error in 'del' command (%s): %v --> %s", cmd.String(), err, string(out))
8484
}
8585
c.expiredDecisionValueSet[decisionToDecisionKey(decision)] = struct{}{}
8686
return nil

0 commit comments

Comments
 (0)