You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

26 lines
612 B

package rabbitmq
import (
"fmt"
"log"
)
// Logger is the interface to send logs to. It can be set using
// WithPublisherOptionsLogger() or WithConsumerOptionsLogger().
type Logger interface {
Printf(string, ...interface{})
}
const loggingPrefix = "gorabbit"
// stdLogger logs to stdout using go's default logger.
type stdLogger struct{}
func (l stdLogger) Printf(format string, v ...interface{}) {
log.Printf(fmt.Sprintf("%s: %s", loggingPrefix, format), v...)
}
// noLogger does not log at all, this is the default.
type noLogger struct{}
func (l noLogger) Printf(format string, v ...interface{}) {}