Date: Tuesday, March 7, 2006 @ 14:46:58
  Author: csaba
    Path: /cvsroot/carob/libmysequoia

   Added: config/logger.conf (1.1) config/mysequoia.conf (1.1)
Modified: include/CarobMySQL.hpp (1.29 -> 1.30) src/CarobMySQL.cpp (1.61
          -> 1.62)
 Removed: config/logger.cfg (1.2)

- added mysequoia.conf file
- renamed logger.cnf to logger.conf


------------------------+
 config/logger.cfg      |   11 -----------
 config/logger.conf     |   11 +++++++++++
 config/mysequoia.conf  |    5 +++++
 include/CarobMySQL.hpp |    4 +++-
 src/CarobMySQL.cpp     |   26 +++++++++++++-------------
 5 files changed, 32 insertions(+), 25 deletions(-)


Index: libmysequoia/config/logger.cfg
diff -u libmysequoia/config/logger.cfg:1.2 
libmysequoia/config/logger.cfg:removed
--- libmysequoia/config/logger.cfg:1.2  Tue Jan 31 16:31:52 2006
+++ libmysequoia/config/logger.cfg      Tue Mar  7 14:46:58 2006
@@ -1,11 +0,0 @@
-log4j.rootLogger=debug, file
-
-log4j.appender.file=org.apache.log4j.RollingFileAppender
-log4j.appender.file.File=/tmp/mysequoia.log
-log4j.appender.file.MaxFileSize=100KB
-log4j.appender.file.MaxBackupIndex=3
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.layout.ConversionPattern=%d %p %t %c (%F:%L) - %m%n
-
-# Print only messages of level DEBUG or above in the namespace MySQLAPI.
-log4j.logger.MySQLAPI=DEBUG
Index: libmysequoia/config/logger.conf
diff -u /dev/null libmysequoia/config/logger.conf:1.1
--- /dev/null   Tue Mar  7 14:46:58 2006
+++ libmysequoia/config/logger.conf     Tue Mar  7 14:46:58 2006
@@ -0,0 +1,11 @@
+log4j.rootLogger=debug, file
+
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.File=/tmp/mysequoia.log
+log4j.appender.file.MaxFileSize=10MB
+log4j.appender.file.MaxBackupIndex=3
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d %p %t %c (%F:%L) - %m%n
+
+# Print only messages of level DEBUG or above in the namespace MySQLAPI.
+log4j.logger.MySQLAPI=DEBUG
Index: libmysequoia/config/mysequoia.conf
diff -u /dev/null libmysequoia/config/mysequoia.conf:1.1
--- /dev/null   Tue Mar  7 14:46:58 2006
+++ libmysequoia/config/mysequoia.conf  Tue Mar  7 14:46:58 2006
@@ -0,0 +1,5 @@
+[client]
+user = root
+password = rootpass
+host=localhost
+database=test
\ No newline at end of file
Index: libmysequoia/include/CarobMySQL.hpp
diff -u libmysequoia/include/CarobMySQL.hpp:1.29 
libmysequoia/include/CarobMySQL.hpp:1.30
--- libmysequoia/include/CarobMySQL.hpp:1.29    Fri Mar  3 13:39:34 2006
+++ libmysequoia/include/CarobMySQL.hpp Tue Mar  7 14:46:58 2006
@@ -43,7 +43,9 @@
 
 const unsigned long MYSEQUOIA_MAGIC = 0xC00CA10B;
 
-#define LOGGER_CONFIG_FILE CONFIGFILE_DIR"/logger.cfg"
+#define LOGGER_CONFIG_FILE CONFIGFILE_DIR"/logger.conf"
+#define MYSEQUOIA_CONFIG_FILE "mysequoia.conf"
+#define GLOBAL_MYSEQUOIA_CONFIG_FILE CONFIGFILE_DIR"/"MYSEQUOIA_CONFIG_FILE
 
 class CarobStmt;
 
Index: libmysequoia/src/CarobMySQL.cpp
diff -u libmysequoia/src/CarobMySQL.cpp:1.61 
libmysequoia/src/CarobMySQL.cpp:1.62
--- libmysequoia/src/CarobMySQL.cpp:1.61        Tue Mar  7 10:28:17 2006
+++ libmysequoia/src/CarobMySQL.cpp     Tue Mar  7 14:46:58 2006
@@ -976,31 +976,31 @@
   LOG4CXX_DEBUG(logger, "Entering read_ini_file.");
 
   char *group;
-  char *def_home_env = getenv("DEFAULT_HOME_ENV");
   char *home_dir = getenv("HOME");
   IniParser ini;
 
 /* 
  * The order of reading the config files:
  * 1. /etc/
- * 2. getenv(DEFAULT_HOME_ENV)
+ * 2. "~/"
  * 3. ""
- * 4. "~/"
- * 5. user supplied options.my_cnf_file
+ * 4. user supplied options.my_cnf_file
  */
 
-  ini.parseFile("/etc/my.cnf");
-  if (def_home_env)
-  {
-    string s = string(def_home_env) + "/my.cnf";
-    ini.parseFile(s.c_str());
-  }
-  ini.parseFile("my.cnf");
+/* 1 */
+  ini.parseFile(GLOBAL_MYSEQUOIA_CONFIG_FILE);
+
+/* 2 */
   if (home_dir)
   {
-    string s = string(home_dir) + "/.my.cnf";
+    string s = string(home_dir) + "/." + MYSEQUOIA_CONFIG_FILE;
     ini.parseFile(s.c_str());
   }
+
+/* 3 */
+  ini.parseFile(MYSEQUOIA_CONFIG_FILE);
+
+/* 4 */
   if (mysqlPtr->options.my_cnf_file)
     ini.parseFile(mysqlPtr->options.my_cnf_file);
 
@@ -1010,7 +1010,7 @@
     group = "client";
   
   /*
-   *  read the host, user, password, db, default-character-set, 
character-sets-dir, port
+   *  read the host, user, password, database, port, default-character-set, 
character-sets-dir
    *  from the config file
    */
   cstrdupcond(mysqlPtr->options.host, ini.get(group, "host").c_str());

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

Reply via email to