func (d *debug) Close() error {
	return nil
}
close is a noop for Debug.
package debug
import (
	"bytes"
	"fmt"
	"github.com/BlueDragonX/beacon/beacon"
)
type Printer interface {
	Print(v ...interface{})
}
func New(pr Printer) beacon.Backend {
	return &debug{
		pr: pr,
	}
}
type debug struct {
	pr Printer
}
func (d *debug) ProcessEvent(event *beacon.Event) error {
	buf := &bytes.Buffer{}
	fmt.Fprintf(buf, "event: svc=%s id=%s action=%s", event.Container.Service, event.Container.ID, event.Action)
	first := true
	for key, value := range event.Container.Labels {
		if first {
			fmt.Fprint(buf, " labels=")
			first = false
		} else {
			fmt.Fprint(buf, ",")
		}
		fmt.Fprintf(buf, "%s:%s", key, value)
	}
	for n, binding := range event.Container.Bindings {
		if n == 0 {
			fmt.Fprint(buf, " ports=")
		} else {
			fmt.Fprint(buf, ",")
		}
		fmt.Fprintf(buf, "%s:%d->%d/%s", binding.HostIP, binding.HostPort, binding.ContainerPort, binding.Protocol)
	}
	fmt.Fprint(buf, "\n")
	d.pr.Print(buf.String())
	return nil
}