From: arjen Date: Thu, 24 Mar 2011 10:20:37 +0000 (+0000) Subject: Added some debug info X-Git-Url: http://www.andromeda.nl/gitweb/?p=gnucomo.git;a=commitdiff_plain;h=8618048bd20a6b9302982755c6717d3ab8110bec Added some debug info --- diff --git a/src/gcm_input/gcm_input.cpp b/src/gcm_input/gcm_input.cpp index 4717f22..526a7ce 100644 --- a/src/gcm_input/gcm_input.cpp +++ b/src/gcm_input/gcm_input.cpp @@ -7,7 +7,7 @@ *********************** ** FILE NAME : gcm_input.cpp ** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring -** VERSION NUMBER : $Revision: 1.15 $ +** VERSION NUMBER : $Revision: 1.16 $ ** ** DESCRIPTION : Application to store client messages into the database ** The client message contains a log file from one of the @@ -54,7 +54,10 @@ /***************************** $Log: gcm_input.cpp,v $ - Revision 1.15 2007-11-14 16:19:25 arjen + Revision 1.16 2011-03-24 10:20:37 arjen + Added some debug info + + Revision 1.15 2007/11/14 16:19:25 arjen Bugfix: Segmentation fault when reading an rpm package list with empty lines. @@ -122,7 +125,7 @@ *****************************/ -static const char *RCSID = "$Id: gcm_input.cpp,v 1.15 2007-11-14 16:19:25 arjen Exp $"; +static const char *RCSID = "$Id: gcm_input.cpp,v 1.16 2011-03-24 10:20:37 arjen Exp $"; #include diff --git a/src/gcm_input/message.cpp b/src/gcm_input/message.cpp index ce006fc..185fa0e 100644 --- a/src/gcm_input/message.cpp +++ b/src/gcm_input/message.cpp @@ -8,7 +8,7 @@ *********************** ** FILE NAME : message.cpp ** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring -** VERSION NUMBER : $Revision: 1.18 $ +** VERSION NUMBER : $Revision: 1.19 $ ** ** DESCRIPTION : Implementation of the message handling classes ** @@ -26,7 +26,10 @@ /***************************** $Log: message.cpp,v $ - Revision 1.18 2007-11-03 10:23:53 arjen + Revision 1.19 2011-03-24 10:20:37 arjen + Added some debug info + + Revision 1.18 2007/11/03 10:23:53 arjen Handling of parameters is greatly improved. When creating a new parameter from an XML report which is fed into gcm_input, the class definition is used as a template to fill in @@ -113,7 +116,7 @@ *****************************/ -static const char *RCSID = "$Id: message.cpp,v 1.18 2007-11-03 10:23:53 arjen Exp $"; +static const char *RCSID = "$Id: message.cpp,v 1.19 2011-03-24 10:20:37 arjen Exp $"; #include #include @@ -990,22 +993,35 @@ void client_message::enterXML() { // Check if any parameters in this class have disappeared. +#ifdef DEBUG + *Log << "Checking for disappeared parameters.\n"; +#endif qry = "select name, paramid from parameter where objectid='"; qry += objectid + "' and class='" + param_class + "'"; int nr_parameters = database.Query(qry); - pqxx::Result parameter_set = database.Result(); + pqxx::result parameter_set = database.Result(); +#ifdef DEBUG + *Log << nr_parameters << " parameters of class " << param_class << " found in the database.\n"; +#endif for (int i = 0; i < nr_parameters; i++) { String XPath; String param_name, paramid; param_name = database.Field(parameter_set, i, "name"); +#ifdef DEBUG + *Log << "Looking for " << param_name << " in XML tree.\n"; +#endif XPath = "gcmt:parameter[@name='" + param_name + "']"; res = xmlXPathEval((const xmlChar *)(const char *)XPath, pathcontext); - if (res->nodesetval->nodeTab == NULL) +#ifdef DEBUG + *Log << "XPATH result: " << res->type << ".\n"; + *Log << "Nr of nodes found: " << res->nodesetval->nodeNr << ".\n"; +#endif + if (res->nodesetval->nodeNr == 0) { // The parameter is in the database but not in the report @@ -1057,6 +1073,12 @@ void client_message::enterXML() } } } + else + { +#ifdef DEBUG + *Log << XPath << " was found in XML tree.\n"; +#endif + } } } }