logger fix
This commit is contained in:
parent
a2862350b3
commit
154320d288
3 changed files with 18 additions and 15 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
amqp "github.com/rabbitmq/amqp091-go"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -36,13 +37,15 @@ type options struct {
|
|||
}
|
||||
|
||||
func NewClient(address Address, queueName string, opts ...Option) (*Client, error) {
|
||||
l := log.New(os.Stdout, "", log.LstdFlags)
|
||||
|
||||
addr, err := address.makeAddr()
|
||||
if err != nil {
|
||||
return nil, errors.Join(errBadAddr, err)
|
||||
}
|
||||
|
||||
if queueName == "" {
|
||||
log.Fatal(errNoQueue)
|
||||
l.Fatal(errNoQueue)
|
||||
}
|
||||
|
||||
client := Client{
|
||||
|
|
@ -50,6 +53,7 @@ func NewClient(address Address, queueName string, opts ...Option) (*Client, erro
|
|||
queueName: queueName,
|
||||
done: make(chan bool),
|
||||
connected: make(chan struct{}),
|
||||
logger: l,
|
||||
}
|
||||
|
||||
o := options{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue