Reorganise logging
This commit is contained in:
@@ -21,11 +21,11 @@ func dial(user, pass string) *stomp.Conn {
|
||||
stomp.ConnOpt.Header("client-id", user+"-mq-client"),
|
||||
)
|
||||
if err != nil {
|
||||
log.Msg.Fatal("Unable to connect to STOMP Client: " + err.Error())
|
||||
log.Fatal("Unable to connect to STOMP Client: " + err.Error())
|
||||
conn.MustDisconnect()
|
||||
}
|
||||
|
||||
log.Msg.Info("Initialised STOMP Client")
|
||||
log.Info("Initialised STOMP Client")
|
||||
return conn
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ func dial(user, pass string) *stomp.Conn {
|
||||
func Disconnect(conn *stomp.Conn) {
|
||||
if conn != nil {
|
||||
err := conn.Disconnect()
|
||||
log.Msg.Warn("Disconnected STOMP Client")
|
||||
log.Warn("Disconnected STOMP Client")
|
||||
if err != nil {
|
||||
conn.MustDisconnect()
|
||||
log.Msg.Error("STOMP Disconnection failed, forced disconnect")
|
||||
log.Error("STOMP Disconnection failed, forced disconnect")
|
||||
}
|
||||
return
|
||||
}
|
||||
log.Msg.Error("STOMP Disconnect failed, next connection attempt may fail")
|
||||
log.Error("STOMP Disconnect failed, next connection attempt may fail")
|
||||
}
|
||||
|
||||
// Register against the MQ Server and log each message for testing purposes
|
||||
|
||||
Reference in New Issue
Block a user