Date: Friday, May 4, 2007 @ 16:28:56
  Author: marc
    Path: /cvsroot/carob/libmysequoia/src

Modified: CarobMySQL.cpp (1.107 -> 1.108)

carob_log_level is no more an integer (0,1,2,...) but a string (DEBUG,
INFO,...). Parsing problems are logged. LMS-39. 


----------------+
 CarobMySQL.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)


Index: libmysequoia/src/CarobMySQL.cpp
diff -u libmysequoia/src/CarobMySQL.cpp:1.107 
libmysequoia/src/CarobMySQL.cpp:1.108
--- libmysequoia/src/CarobMySQL.cpp:1.107       Fri May  4 15:53:39 2007
+++ libmysequoia/src/CarobMySQL.cpp     Fri May  4 16:28:56 2007
@@ -1227,7 +1227,8 @@
   string carobLogLevel = ini.get(group, "carob_log_level");
   if (! carobLogLevel.empty())
   {
-        switch (atoi(carobLogLevel.c_str()))
+    try {
+     switch (LogLevel(StringLogLevel(carobLogLevel.c_str())))
       {
         case LOG_LEVEL_DEBUG: setLogLevel(LOG_LEVEL_DEBUG); break; 
         case LOG_LEVEL_INFO:  setLogLevel(LOG_LEVEL_INFO); break;
@@ -1236,6 +1237,10 @@
         case LOG_LEVEL_FATAL: setLogLevel(LOG_LEVEL_FATAL); break;
         case LOG_LEVEL_OFF:   setLogLevel(LOG_LEVEL_OFF); break;
       }
+    } catch (std::string err) {
+      LOG4CXX_ERROR(logger, "wrong carob_log_level property: " << err);
+      // do nothing, let the regular log4cxx level inheritance do its work
+    }
   }
 
   LOG4CXX_DEBUG(logger, "Leaving read_ini_file.");

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to