added logrus for logging

alpha v1.0.16
alex 2023-01-08 16:05:37 +01:00
parent 1053a20f2c
commit f0f8872ab6
1 changed files with 2 additions and 1 deletions

View File

@ -136,6 +136,7 @@ func GetConnectionString(username string, password string, host string) string {
// attempts to connect to the server.
func NewClient(debugMode bool, exchangeSettings ExchangeSettings, queueSettings QueueSettings, channelQosSettings ChannelQosSettings, config Config, addr string) *Client {
client := Client{
logger: logrus.New(),
exchangeSettings: exchangeSettings,
queueSettings: queueSettings,
channelQosSettings: channelQosSettings,
@ -144,7 +145,7 @@ func NewClient(debugMode bool, exchangeSettings ExchangeSettings, queueSettings
}
if debugMode {
logrus.SetLevel(logrus.DebugLevel)
client.logger.SetLevel(logrus.DebugLevel)
}
go client.handleReconnect(addr)