You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by af...@apache.org on 2008/09/18 20:03:02 UTC

svn commit: r696744 - in /logging/log4cxx/trunk/src: main/cpp/logger.cpp test/cpp/l7dtestcase.cpp test/resources/L7D_fr.properties test/resources/witness/l7d.1

Author: afester
Date: Thu Sep 18 11:03:02 2008
New Revision: 696744

URL: http://svn.apache.org/viewvc?rev=696744&view=rev
Log:
LOGCXX-310: fixed array index when logging localized messages
with three parameters

Modified:
    logging/log4cxx/trunk/src/main/cpp/logger.cpp
    logging/log4cxx/trunk/src/test/cpp/l7dtestcase.cpp
    logging/log4cxx/trunk/src/test/resources/L7D_fr.properties
    logging/log4cxx/trunk/src/test/resources/witness/l7d.1

Modified: logging/log4cxx/trunk/src/main/cpp/logger.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/cpp/logger.cpp?rev=696744&r1=696743&r2=696744&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/cpp/logger.cpp (original)
+++ logging/log4cxx/trunk/src/main/cpp/logger.cpp Thu Sep 18 11:03:02 2008
@@ -426,7 +426,7 @@
   std::vector<LogString> values(3);
   values[0] = lval1;
   values[1] = lval2;
-  values[3] = lval3;
+  values[2] = lval3;
   l7dlog(level1, lkey, location, values);
 }
 

Modified: logging/log4cxx/trunk/src/test/cpp/l7dtestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/l7dtestcase.cpp?rev=696744&r1=696743&r2=696744&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/l7dtestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/l7dtestcase.cpp Thu Sep 18 11:03:02 2008
@@ -94,6 +94,9 @@
                         LOG4CXX_L7DLOG2(root, Level::getError(), LOG4CXX_TEST_STR("msg1"), os.str().c_str(),
                                  LOG4CXX_TEST_STR("log4j"));
                         LOG4CXX_L7DLOG(root, Level::getInfo(), LOG4CXX_TEST_STR("bogus2"));
+
+                        LOG4CXX_L7DLOG3(root, Level::getError(), LOG4CXX_TEST_STR("msg3"), os.str().c_str(),
+                                 LOG4CXX_TEST_STR("log4j"), LOG4CXX_TEST_STR("log4cxx"));
                 }
 
                 LOGUNIT_ASSERT(Compare::compare(LOG4CXX_FILE("output/temp"),

Modified: logging/log4cxx/trunk/src/test/resources/L7D_fr.properties
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/resources/L7D_fr.properties?rev=696744&r1=696743&r2=696744&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/resources/L7D_fr.properties (original)
+++ logging/log4cxx/trunk/src/test/resources/L7D_fr.properties Thu Sep 18 11:03:02 2008
@@ -16,3 +16,4 @@
 test=Ceci est le test en francais pour la France.
 hello_world=Bonjour la France.
 msg1=Ceci est le test numero {0} contenant l'argument {1}.
+msg3=Ceci est le test numero {0} contenant l'argument {1} et l'argument {2}.

Modified: logging/log4cxx/trunk/src/test/resources/witness/l7d.1
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/resources/witness/l7d.1?rev=696744&r1=696743&r2=696744&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/resources/witness/l7d.1 (original)
+++ logging/log4cxx/trunk/src/test/resources/witness/l7d.1 Thu Sep 18 11:03:02 2008
@@ -5,6 +5,8 @@
 T1 ERROR - This is test number 1 with string argument log4j.
 T1 ERROR - No resource is associated with key "bogus2".
 T1  INFO - bogus2
+T1 ERROR - No resource is associated with key "msg3".
+T1 ERROR - msg3
 T1  INFO - Ceci est le test en francais pour la France.
 T1  WARN - Bonjour la France.
 T1 ERROR - No resource is associated with key "bogusMsg".
@@ -12,6 +14,7 @@
 T1 ERROR - Ceci est le test numero 2 contenant l'argument log4j.
 T1 ERROR - No resource is associated with key "bogus2".
 T1  INFO - bogus2
+T1 ERROR - Ceci est le test numero 2 contenant l'argument log4j et l'argument log4cxx.
 T1  INFO - Ceci est le test en francais pour la p'tite Suisse.
 T1  WARN - Bonjour la France.
 T1 ERROR - No resource is associated with key "bogusMsg".
@@ -19,3 +22,4 @@
 T1 ERROR - Ceci est le test numero 3 contenant l'argument log4j.
 T1 ERROR - No resource is associated with key "bogus2".
 T1  INFO - bogus2
+T1 ERROR - Ceci est le test numero 3 contenant l'argument log4j et l'argument log4cxx.