return error
}
- // send the message
- log.WithFields(logger.Fields{
- "context": chMeta.id,
- "msg_id": msgID,
- "msg_size": len(data),
- }).Debug("Sending a message to VPP.")
+ if log.Level == logger.DebugLevel { // for performance reasons - logrus does some processing even if debugs are disabled
+ log.WithFields(logger.Fields{
+ "context": chMeta.id,
+ "msg_id": msgID,
+ "msg_size": len(data),
+ }).Debug("Sending a message to VPP.")
+ }
+ // send the message
if req.Multipart {
// expect multipart response
atomic.StoreUint32(&chMeta.multipart, 1)
return
}
- log.WithFields(logger.Fields{
- "context": context,
- "msg_id": msgID,
- "msg_size": len(data),
- }).Debug("Received a message from VPP.")
+ if log.Level == logger.DebugLevel { // for performance reasons - logrus does some processing even if debugs are disabled
+ log.WithFields(logger.Fields{
+ "context": context,
+ "msg_id": msgID,
+ "msg_size": len(data),
+ }).Debug("Received a message from VPP.")
+ }
if context == 0 || conn.isNotificationMessage(msgID) {
// process the message as a notification