Log more precise DCB write error messages

The DCB error messages now log the type of the DCB and the remote address
in addition to the system error message. The file descriptor and memory
address are no longer printed in the error message as they are not useful
to the end user. The fd and address are now logged at debug level with a
more verbose error message.
This commit is contained in:
Markus Makela
2016-10-09 10:00:58 +03:00
parent 53f01106aa
commit cd11971d5d
3 changed files with 12 additions and 65 deletions

View File

@ -156,6 +156,11 @@ typedef enum
DCB_ROLE_INTERNAL /*< Internal DCB not connected to the outside */
} dcb_role_t;
#define DCB_STRTYPE(dcb) (dcb->dcb_role == DCB_ROLE_CLIENT_HANDLER ? "Client DCB" : \
dcb->dcb_role == DCB_ROLE_BACKEND_HANDLER ? "Backend DCB" : \
dcb->dcb_role == DCB_ROLE_SERVICE_LISTENER ? "Listener DCB" : \
dcb->dcb_role == DCB_ROLE_INTERNAL ? "Internal DCB" : "Unknown DCB")
/**
* Callback reasons for the DCB callback mechanism.
*/