Skip to content

Commit

Permalink
improve debug
Browse files Browse the repository at this point in the history
  • Loading branch information
AlteredCoder authored and AlteredCoder committed Dec 3, 2020
1 parent 380763d commit cd39e10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (c *customBouncer) Delete(decision *models.Decision) error {
if err != nil {
log.Warningf("serialize: %s", err)
}
log.Printf("custom [%s] : del ban on %s for %s sec (%s)", c.path, *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario)
cmd := exec.Command(c.path, "del", *decision.Value, strconv.Itoa(int(banDuration.Seconds())), *decision.Scenario, str)
if out, err := cmd.CombinedOutput(); err != nil {
log.Infof("Error in 'del' command (%s): %v --> %s", cmd.String(), err, string(out))
Expand Down
5 changes: 1 addition & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"os"
"os/signal"
"strings"
"syscall"

"github.com/coreos/go-systemd/daemon"
Expand Down Expand Up @@ -107,9 +106,7 @@ func main() {
log.Infof("deleting '%d' decisions", len(decisions.Deleted))
for _, decision := range decisions.Deleted {
if err := custom.Delete(decision); err != nil {
if !strings.Contains(err.Error(), "netlink receive: no such file or directory") {
log.Errorf("unable to delete decision for '%s': %s", *decision.Value, err)
}
log.Errorf("unable to delete decision for '%s': %s", *decision.Value, err)
} else {
log.Debugf("deleted '%s'", *decision.Value)
}
Expand Down

0 comments on commit cd39e10

Please sign in to comment.