summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/can/can-message.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-04-22 13:57:41 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-04-22 13:57:41 +0200
commitf0973849c4df5740ffb241a21fc08398fa741a7e (patch)
treed4adca2a6a70d6bd44adf60f3a774d29b968d5b4 /CAN-binder/low-can-binding/can/can-message.cpp
parent98766025818904420be6088e60453b885a05e9d7 (diff)
Improve logging messages
Added for all log messages function name at beginning using __FUNCTION__ macro. Change-Id: Ia0f476ca81b9f79c6d49b425c0520894c59797ea Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/can/can-message.cpp')
-rw-r--r--CAN-binder/low-can-binding/can/can-message.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/CAN-binder/low-can-binding/can/can-message.cpp b/CAN-binder/low-can-binding/can/can-message.cpp
index f61de67..f27dce3 100644
--- a/CAN-binder/low-can-binding/can/can-message.cpp
+++ b/CAN-binder/low-can-binding/can/can-message.cpp
@@ -140,7 +140,7 @@ void can_message_t::set_format(const can_message_format_t new_format)
if(new_format == can_message_format_t::STANDARD || new_format == can_message_format_t::EXTENDED || new_format == can_message_format_t::ERROR)
format_ = new_format;
else
- ERROR(binder_interface, "ERROR: Can set format, wrong format chosen");
+ ERROR(binder_interface, "%s: Can set format, wrong format chosen", __FUNCTION__);
}
///
@@ -164,15 +164,15 @@ can_message_t can_message_t::convert_from_canfd_frame(const struct canfd_frame&
switch(nbytes)
{
case CANFD_MTU:
- DEBUG(binder_interface, "set_max_data_length: Got an CAN FD frame");
+ DEBUG(binder_interface, "%s: Got an CAN FD frame", __FUNCTION__);
maxdlen = CANFD_MAX_DLEN;
break;
case CAN_MTU:
- DEBUG(binder_interface, "set_max_data_length: Got a legacy CAN frame");
+ DEBUG(binder_interface, "%s: Got a legacy CAN frame", __FUNCTION__);
maxdlen = CAN_MAX_DLEN;
break;
default:
- ERROR(binder_interface, "set_max_data_length: unsupported CAN frame");
+ ERROR(binder_interface, "%s: unsupported CAN frame", __FUNCTION__);
break;
}
@@ -195,7 +195,7 @@ can_message_t can_message_t::convert_from_canfd_frame(const struct canfd_frame&
id = frame.can_id & (CAN_ERR_MASK|CAN_ERR_FLAG);
break;
default:
- ERROR(binder_interface, "ERROR: Can set id, not a compatible format or format not set prior to set id.");
+ ERROR(binder_interface, "%s: Can set id, not a compatible format or format not set prior to set id.", __FUNCTION__);
break;
}
@@ -233,7 +233,7 @@ can_message_t can_message_t::convert_from_canfd_frame(const struct canfd_frame&
data.push_back(frame.data[i]);
};
- DEBUG(binder_interface, "convert_from_canfd_frame: Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X",
+ DEBUG(binder_interface, "%s: Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", __FUNCTION__,
id, (uint8_t)format, length, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
}
@@ -258,7 +258,7 @@ canfd_frame can_message_t::convert_to_canfd_frame()
::memcpy(frame.data, get_data(), length_);
}
else
- ERROR(binder_interface, "can_message_t not correctly initialized to be sent");
+ ERROR(binder_interface, "%s: can_message_t not correctly initialized to be sent", __FUNCTION__);
return frame;
}