Improvements with debug details
FossilOrigin-Name: fb15ceffecddd7b8356e0f2cfde238d5328b09ba578c8670b217f761acf7ed37
This commit is contained in:
parent
7128df99a3
commit
8dd91ab6af
@ -41,6 +41,7 @@ struct wtpman{
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
struct wtp{
|
struct wtp{
|
||||||
|
|
||||||
|
|
||||||
@ -48,6 +49,8 @@ struct wtp{
|
|||||||
|
|
||||||
|
|
||||||
//extern void wtpman_run(void *arg);
|
//extern void wtpman_run(void *arg);
|
||||||
|
*/
|
||||||
|
|
||||||
extern struct wtpman * wtpman_create();
|
extern struct wtpman * wtpman_create();
|
||||||
|
|
||||||
extern struct wtpman * wtpman_create(int socklistindex,struct sockaddr * srcaddr);
|
extern struct wtpman * wtpman_create(int socklistindex,struct sockaddr * srcaddr);
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
|
int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
|
||||||
, uint8_t * dst)
|
, uint8_t * dst)
|
||||||
{
|
{
|
||||||
|
char detail[128];
|
||||||
struct cw_KTV * elem, search;
|
struct cw_KTV * elem, search;
|
||||||
int start, len;
|
int start, len;
|
||||||
/* Get the element to put */
|
/* Get the element to put */
|
||||||
@ -29,8 +30,8 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
|
|||||||
}
|
}
|
||||||
if ( params->elemdata->mand) {
|
if ( params->elemdata->mand) {
|
||||||
cw_log(LOG_ERR,
|
cw_log(LOG_ERR,
|
||||||
"Can't put mandatory element %s %d - (%s) into %s. No value for '%s' found.",
|
"Can't put mandatory element %s %d-(%s) into %s. No value for '%s' found.",
|
||||||
vendor, handler->id, handler->name, "nona"
|
vendor, handler->id, handler->name, params->msgdata->name
|
||||||
, handler->key
|
, handler->key
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -44,6 +45,13 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
len = handler->type->put(elem,dst+start);
|
len = handler->type->put(elem,dst+start);
|
||||||
|
|
||||||
|
|
||||||
|
handler->type->to_str(elem,detail,120);
|
||||||
|
sprintf(params->debug_details, " Value = %s", detail);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
params->elem = elem;
|
params->elem = elem;
|
||||||
|
|
||||||
/*(cw_put_mbag_item(dst + start, item);*/
|
/*(cw_put_mbag_item(dst + start, item);*/
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
*/
|
*/
|
||||||
int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
||||||
{
|
{
|
||||||
|
char details[1024];
|
||||||
uint8_t *msgptr,*dst;
|
uint8_t *msgptr,*dst;
|
||||||
int type;
|
int type;
|
||||||
struct cw_MsgData * msg;
|
struct cw_MsgData * msg;
|
||||||
@ -87,11 +88,17 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
|||||||
params.conn=conn;
|
params.conn=conn;
|
||||||
params.elemdata = data;
|
params.elemdata = data;
|
||||||
params.elem=NULL;
|
params.elem=NULL;
|
||||||
|
params.msgdata=msg;
|
||||||
|
params.debug_details=details;
|
||||||
|
*details=0;
|
||||||
|
|
||||||
l = handler->put(handler,¶ms,dst+len);
|
l = handler->put(handler,¶ms,dst+len);
|
||||||
|
|
||||||
if(l>0)
|
if(l>0)
|
||||||
cw_dbg_elem(DBG_ELEM_OUT,conn,type,handler,dst+len,l);
|
cw_dbg_elem(DBG_ELEM_OUT,conn,type,handler,dst+len,l);
|
||||||
|
if (strlen(details)){
|
||||||
|
cw_dbg(DBG_ELEM_DETAIL," %s",params.debug_details);
|
||||||
|
}
|
||||||
len += l;
|
len += l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,9 @@ static int put(const cw_KTV_t *data, uint8_t * dst)
|
|||||||
|
|
||||||
static int to_str(const cw_KTV_t *data, char *dst, int max_len)
|
static int to_str(const cw_KTV_t *data, char *dst, int max_len)
|
||||||
{
|
{
|
||||||
|
if (max_len<3){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return sprintf(dst, "%d", data->val.byte);
|
return sprintf(dst, "%d", data->val.byte);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ struct cw_ElemHandlerParams {
|
|||||||
struct sockaddr *from;
|
struct sockaddr *from;
|
||||||
mavl_t mand_found;
|
mavl_t mand_found;
|
||||||
cw_KTV_t * elem;
|
cw_KTV_t * elem;
|
||||||
|
char * debug_details;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cw_ElemHandler {
|
struct cw_ElemHandler {
|
||||||
|
Loading…
Reference in New Issue
Block a user