parent
f0aed7b9d6
commit
1053a20f2c
|
@ -134,9 +134,8 @@ func GetConnectionString(username string, password string, host string) string {
|
|||
|
||||
// New creates a new consumer state instance, and automatically
|
||||
// attempts to connect to the server.
|
||||
func NewClient(logger *logrus.Logger, exchangeSettings ExchangeSettings, queueSettings QueueSettings, channelQosSettings ChannelQosSettings, config Config, addr string) *Client {
|
||||
func NewClient(debugMode bool, exchangeSettings ExchangeSettings, queueSettings QueueSettings, channelQosSettings ChannelQosSettings, config Config, addr string) *Client {
|
||||
client := Client{
|
||||
logger: logger,
|
||||
exchangeSettings: exchangeSettings,
|
||||
queueSettings: queueSettings,
|
||||
channelQosSettings: channelQosSettings,
|
||||
|
@ -144,6 +143,10 @@ func NewClient(logger *logrus.Logger, exchangeSettings ExchangeSettings, queueSe
|
|||
done: make(chan bool),
|
||||
}
|
||||
|
||||
if debugMode {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
}
|
||||
|
||||
go client.handleReconnect(addr)
|
||||
return &client
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue