diff --git a/include/iscsi.h b/include/iscsi.h index 30aa5ea..cae57f3 100644 --- a/include/iscsi.h +++ b/include/iscsi.h @@ -959,7 +959,17 @@ iscsi_scsi_task_cancel(struct iscsi_context *iscsi, EXTERN void iscsi_scsi_cancel_all_tasks(struct iscsi_context *iscsi); -#define DPRINTF(iscsi,level,fmt,args...) do { if ((iscsi)->debug >= level) {fprintf(stderr,"libiscsi: ");fprintf(stderr, (fmt), ##args); fprintf(stderr,"\n");} } while (0); +#define DPRINTF(iscsi,level,fmt,args...) \ + do { \ + if ((iscsi)->debug >= level) { \ + fprintf(stderr,"libiscsi: "); \ + fprintf(stderr, (fmt), ##args); \ + if (iscsi->target_name) { \ + fprintf(stderr," [%s]",iscsi->target_name); \ + } \ + fprintf(stderr,"\n"); \ + } \ + } while (0); /* * This function is to set the debugging level (0=disabled).