summaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/utils/socket.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/utils/socket.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/utils/socket.cpp')
-rw-r--r--CAN-binder/low-can-binding/utils/socket.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/CAN-binder/low-can-binding/utils/socket.cpp b/CAN-binder/low-can-binding/utils/socket.cpp
index e166b8c9..01937ed4 100644
--- a/CAN-binder/low-can-binding/utils/socket.cpp
+++ b/CAN-binder/low-can-binding/utils/socket.cpp
@@ -116,10 +116,10 @@ namespace utils
// Attempts to open a socket to CAN bus
::strcpy(ifr.ifr_name, device_name.c_str());
- DEBUG(binder_interface, "open: ifr_name is : %s", ifr.ifr_name);
+ DEBUG(binder_interface, "%s: ifr_name is : %s", __FUNCTION__, ifr.ifr_name);
if(::ioctl(socket_, SIOCGIFINDEX, &ifr) < 0)
{
- ERROR(binder_interface, "open: ioctl failed. Error was : %s", strerror(errno));
+ ERROR(binder_interface, "%s: ioctl failed. Error was : %s", __FUNCTION__, strerror(errno));
close();
}
else
@@ -129,13 +129,13 @@ namespace utils
if(bcm && connect((struct sockaddr *)&txAddress_, sizeof(txAddress_)) < 0)
{
- ERROR(binder_interface, "Connect failed. %s", strerror(errno));
+ ERROR(binder_interface, "%s: Connect failed. %s", __FUNCTION__, strerror(errno));
close();
}
// It's a RAW socket request, bind it to txAddress
else if(bind((struct sockaddr *)&txAddress_, sizeof(txAddress_)) < 0)
{
- ERROR(binder_interface, "Bind failed. %s", strerror(errno));
+ ERROR(binder_interface, "%s: Bind failed. %s", __FUNCTION__, strerror(errno));
close();
}
}