projects
/
gnucomo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4963199
)
Catch exceptions from the database library
author
arjen
<arjen>
Mon, 27 Oct 2003 13:00:15 +0000
(13:00 +0000)
committer
arjen
<arjen>
Mon, 27 Oct 2003 13:00:15 +0000
(13:00 +0000)
src/gcm_input/gcm_input.cpp
patch
|
blob
|
history
diff --git
a/src/gcm_input/gcm_input.cpp
b/src/gcm_input/gcm_input.cpp
index
e57b6f2
..
4215aa4
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
0
$
+** VERSION NUMBER : $Revision: 1.1
1
$
**
** 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.10 2003-09-03 06:58:31 arjen
+ Revision 1.11 2003-10-27 13:00:15 arjen
+ Catch exceptions from the database library
+
+ Revision 1.10 2003/09/03 06:58:31 arjen
Changed version string to 0.0.8
Revision 1.9 2003/09/01 06:59:26 arjen
Changed version string to 0.0.8
Revision 1.9 2003/09/01 06:59:26 arjen
@@
-100,7
+103,7
@@
*****************************/
*****************************/
-static const char *RCSID = "$Id: gcm_input.cpp,v 1.1
0 2003-09-03 06:58:31
arjen Exp $";
+static const char *RCSID = "$Id: gcm_input.cpp,v 1.1
1 2003-10-27 13:00:15
arjen Exp $";
#include <fstream>
#include <fstream>
@@
-218,11
+221,10
@@
int main(int argc, char *argv[])
String log_method = cfg.find_parameter("logging", "method");
String log_destination = cfg.find_parameter("logging", "destination");
String log_method = cfg.find_parameter("logging", "method");
String log_destination = cfg.find_parameter("logging", "destination");
- int level = cfg.find_parameter("
gcm_input
", "level");
+ int level = cfg.find_parameter("
logging
", "level");
if (log_method == "file" && log_destination != "")
{
if (log_method == "file" && log_destination != "")
{
- std::cerr << "Logging to " << log_destination << ".\n";
#if __GNUC__ == 2
logfile.open(log_destination, _IO_APPEND); // for gcc 2
#else
#if __GNUC__ == 2
logfile.open(log_destination, _IO_APPEND); // for gcc 2
#else
@@
-235,9
+237,9
@@
int main(int argc, char *argv[])
else
{
log = &logfile;
else
{
log = &logfile;
- verbose = verbose || level > 0;
}
}
}
}
+ verbose = verbose || level > 0;
if (verbose)
{
if (verbose)
{
@@
-267,7
+269,14
@@
int main(int argc, char *argv[])
if (msg.classify(hostname, arrival, service) > 0.9)
{
if (msg.classify(hostname, arrival, service) > 0.9)
{
- msg.enter();
+ try
+ {
+ msg.enter();
+ }
+ catch (exception &e)
+ {
+ *log << "Caught an exception: " << e.what() << "\n";
+ }
}
return 0;
}
}
return 0;
}