projects
/
gnucomo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1b77228
)
Added some debug info
author
arjen
<arjen>
Thu, 24 Mar 2011 10:20:37 +0000
(10:20 +0000)
committer
arjen
<arjen>
Thu, 24 Mar 2011 10:20:37 +0000
(10:20 +0000)
src/gcm_input/gcm_input.cpp
patch
|
blob
|
history
src/gcm_input/message.cpp
patch
|
blob
|
history
diff --git
a/src/gcm_input/gcm_input.cpp
b/src/gcm_input/gcm_input.cpp
index
4717f22
..
526a7ce
100644
(file)
--- 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
***********************
** FILE NAME : gcm_input.cpp
** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring
-** VERSION NUMBER : $Revision: 1.1
5
$
+** VERSION NUMBER : $Revision: 1.1
6
$
**
** DESCRIPTION : Application to store client messages into the database
** The client message contains a log file from one of the
**
** 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 $
/*****************************
$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.
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.1
5 2007-11-14 16:19:25
arjen Exp $";
+static const char *RCSID = "$Id: gcm_input.cpp,v 1.1
6 2011-03-24 10:20:37
arjen Exp $";
#include <fstream>
#include <fstream>
diff --git
a/src/gcm_input/message.cpp
b/src/gcm_input/message.cpp
index
ce006fc
..
185fa0e
100644
(file)
--- 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
***********************
** FILE NAME : message.cpp
** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring
-** VERSION NUMBER : $Revision: 1.1
8
$
+** VERSION NUMBER : $Revision: 1.1
9
$
**
** DESCRIPTION : Implementation of the message handling classes
**
**
** DESCRIPTION : Implementation of the message handling classes
**
@@
-26,7
+26,10
@@
/*****************************
$Log: message.cpp,v $
/*****************************
$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
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.1
8 2007-11-03 10:23:53
arjen Exp $";
+static const char *RCSID = "$Id: message.cpp,v 1.1
9 2011-03-24 10:20:37
arjen Exp $";
#include <algorithm>
#include <libxml/xpath.h>
#include <algorithm>
#include <libxml/xpath.h>
@@
-990,22
+993,35
@@
void client_message::enterXML()
{
// Check if any parameters in this class have disappeared.
{
// 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);
qry = "select name, paramid from parameter where objectid='";
qry += objectid + "' and class='" + param_class + "'";
int nr_parameters = database.Query(qry);
- pqxx::
R
esult parameter_set = database.Result();
+ pqxx::
r
esult 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");
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);
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
{
// 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
+ }
}
}
}
}
}
}