wagslane / go-rabbitmq

A wrapper of streadway/amqp that provides reconnection logic and sane defaults
https://blog.boot.dev/golang/connecting-to-rabbitmq-in-golang-easy/
MIT License
772 stars 126 forks source link

Refactored `Logger` interface, Printf usages replaced by Debug, Info, Warning, Error methods #73

Closed metalrex100 closed 2 years ago

metalrex100 commented 2 years ago

Closing #72

wagslane commented 2 years ago

I like this approach, but let's change it to Debugf Infof... etc. Then use a variadic function. So much more flexible

metalrex100 commented 2 years ago

@wagslane As I explained in issue the problem with variadic parameter is that inside your Logger implementation you don't really know what will be placed in this variadic param and what should you do with it.

I would understand if you wanted to add named arguments, but just slice with interface values is a black box in which you can put everything.

What if I in my implementation will decide to ignore it since I don't know what does in contain? Then if you will use Infof as analog of fmt.Printf I will have in my log only template string with placeholders instead of actual values.