logger fix

This commit is contained in:
nquidox 2026-04-08 12:05:39 +03:00
parent a2862350b3
commit 154320d288
3 changed files with 18 additions and 15 deletions

View file

@ -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{