Author: tschoening Date: Mon Feb 10 14:32:56 2014 New Revision: 1566638 URL: http://svn.apache.org/r1566638 Log: LOGCXX-368: method and class name functions not properly implemented
Modified: incubator/log4cxx/trunk/src/changes/changes.xml incubator/log4cxx/trunk/src/main/cpp/locationinfo.cpp Modified: incubator/log4cxx/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/changes/changes.xml?rev=1566638&r1=1566637&r2=1566638&view=diff ============================================================================== --- incubator/log4cxx/trunk/src/changes/changes.xml (original) +++ incubator/log4cxx/trunk/src/changes/changes.xml Mon Feb 10 14:32:56 2014 @@ -67,6 +67,7 @@ <action issue="LOGCXX-365" type="fix">Unit tests fail on system dates later than 2009-12-31.</action> <action issue="LOGCXX-366" type="fix">Errors when compile log4cxx 0.10.0 under Win7 x64 with Visual Studio 2010 (due to Christian Boos and Feng Nan)</action> <action issue="LOGCXX-367" type="fix">Build fails on Linux with g++ 4.4</action> + <action issue="LOGCXX-368" type="fix">method and class name functions not properly implemented</action> <action issue="LOGCXX-381" type="fix">Pkgconfig can't find dependencies properly if log4cxx built statically</action> <action issue="LOGCXX-382" type="fix">Mingw build type conversion error</action> <action issue="LOGCXX-388" type="fix">Hierarchy::updateParents loops forever on illegal logger-name like '.logger1'</action> Modified: incubator/log4cxx/trunk/src/main/cpp/locationinfo.cpp URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/locationinfo.cpp?rev=1566638&r1=1566637&r2=1566638&view=diff ============================================================================== --- incubator/log4cxx/trunk/src/main/cpp/locationinfo.cpp (original) +++ incubator/log4cxx/trunk/src/main/cpp/locationinfo.cpp Mon Feb 10 14:32:56 2014 @@ -112,7 +112,11 @@ using namespace log4cxx::helpers; const std::string LocationInfo::getMethodName() const { std::string tmp(methodName); - size_t colonPos = tmp.find("::"); + size_t parenPos = tmp.find('('); + if (parenPos != std::string::npos) { + tmp.erase(parenPos); + } + size_t colonPos = tmp.rfind("::"); if (colonPos != std::string::npos) { tmp.erase(0, colonPos + 2); } else { @@ -121,17 +125,17 @@ using namespace log4cxx::helpers; tmp.erase(0, spacePos + 1); } } - size_t parenPos = tmp.find('('); - if (parenPos != std::string::npos) { - tmp.erase(parenPos); - } return tmp; } const std::string LocationInfo::getClassName() const { std::string tmp(methodName); - size_t colonPos = tmp.find("::"); + size_t parenPos = tmp.find('('); + if (parenPos != std::string::npos) { + tmp.erase(parenPos); + } + size_t colonPos = tmp.rfind("::"); if (colonPos != std::string::npos) { tmp.erase(colonPos); size_t spacePos = tmp.find_last_of(' ');