Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

svn commit: r540989 - in /logging/log4cxx/trunk: docs/ examples/ include/lo: msg#00011

apache.logging.log4cxx.devel

Subject: svn commit: r540989 - in /logging/log4cxx/trunk: docs/ examples/ include/log4cxx/ include/log4cxx/spi/ performance/ simplesocketserver/ src/ tests/src/ tests/src/helpers/ tests/src/nt/ tests/src/pattern/ tests/src/rolling/ tests/src/varia/

Author: carnold
Date: Wed May 23 09:29:08 2007
New Revision: 540989

URL: http://svn.apache.org/viewvc?view=rev&rev=540989
Log:
LOGCXX-181: Level::DEBUG and other non-local statics cause crash on app
shutdown on AIX

Modified:
logging/log4cxx/trunk/docs/introduction.dox
logging/log4cxx/trunk/examples/delayedloop.cpp
logging/log4cxx/trunk/examples/stream.cpp
logging/log4cxx/trunk/include/log4cxx/level.h
logging/log4cxx/trunk/include/log4cxx/logger.h
logging/log4cxx/trunk/include/log4cxx/spi/loggerrepository.h
logging/log4cxx/trunk/performance/main.cpp
logging/log4cxx/trunk/simplesocketserver/simplesocketserver.cpp
logging/log4cxx/trunk/src/level.cpp
logging/log4cxx/trunk/src/smtpappender.cpp
logging/log4cxx/trunk/tests/src/appenderskeletontestcase.cpp
logging/log4cxx/trunk/tests/src/encodingtest.cpp
logging/log4cxx/trunk/tests/src/helpers/cyclicbuffertestcase.cpp
logging/log4cxx/trunk/tests/src/l7dtestcase.cpp
logging/log4cxx/trunk/tests/src/loggertestcase.cpp
logging/log4cxx/trunk/tests/src/minimumtestcase.cpp
logging/log4cxx/trunk/tests/src/nt/nteventlogappendertestcase.cpp
logging/log4cxx/trunk/tests/src/pattern/patternparsertestcase.cpp
logging/log4cxx/trunk/tests/src/patternlayouttest.cpp
logging/log4cxx/trunk/tests/src/rolling/filterbasedrollingtest.cpp
logging/log4cxx/trunk/tests/src/streamtestcase.cpp
logging/log4cxx/trunk/tests/src/varia/levelmatchfiltertestcase.cpp
logging/log4cxx/trunk/tests/src/varia/levelrangefiltertestcase.cpp

Modified: logging/log4cxx/trunk/docs/introduction.dox
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/docs/introduction.dox?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/docs/introduction.dox (original)
+++ logging/log4cxx/trunk/docs/introduction.dox Wed May 23 09:29:08 2007
@@ -273,7 +273,7 @@
// Now set its level. Normally you do not need to set the
// level of a logger programmatically. This is usually done
// in configuration files.
-logger->setLevel(log4cxx::Level::INFO);
+logger->setLevel(log4cxx::Level::getInfo());

log4cxx::LoggerPtr barlogger(Logger::getLogger(("com.foo.Bar"));


Modified: logging/log4cxx/trunk/examples/delayedloop.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/examples/delayedloop.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/examples/delayedloop.cpp (original)
+++ logging/log4cxx/trunk/examples/delayedloop.cpp Wed May 23 09:29:08 2007
@@ -77,7 +77,7 @@
static void test()
{
int i = 0;
- logstream log(logger, Level::DEBUG);
+ logstream log(logger, Level::getDebug());
while(true)
{
log << L"MSG " << i++ << LOG4CXX_ENDMSG;

Modified: logging/log4cxx/trunk/examples/stream.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/examples/stream.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/examples/stream.cpp (original)
+++ logging/log4cxx/trunk/examples/stream.cpp Wed May 23 09:29:08 2007
@@ -36,21 +36,21 @@

NDC::push("trivial context");

- log4cxx::logstream logstream(rootLogger, Level::DEBUG);
+ log4cxx::logstream logstream(rootLogger, Level::getDebug());
logstream << "debug message " << 1 << LOG4CXX_ENDMSG;
- logstream.setLevel(Level::INFO);
+ logstream.setLevel(Level::getInfo());
#if LOG4CXX_HAS_WCHAR_T
logstream << L"info message" << LOG4CXX_ENDMSG;
#else
logstream << "info message" << LOG4CXX_ENDMSG;
#endif
- logstream << Level::WARN << "warn message" << LOG4CXX_ENDMSG;
+ logstream << Level::getWarn() << "warn message" <<
LOG4CXX_ENDMSG;
#if LOG4CXX_HAS_WCHAR_T
- logstream << Level::ERROR << L"error message" <<
LOG4CXX_ENDMSG;
+ logstream << Level::getError() << L"error message" <<
LOG4CXX_ENDMSG;
#else
- logstream << Level::ERROR << "error message" << LOG4CXX_ENDMSG;
+ logstream << Level::getError() << "error message" <<
LOG4CXX_ENDMSG;
#endif
- logstream << Level::FATAL << "fatal message" << LOG4CXX_ENDMSG;
+ logstream << Level::getFatal() << "fatal message" <<
LOG4CXX_ENDMSG;


NDC::pop();

Modified: logging/log4cxx/trunk/include/log4cxx/level.h
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/level.h?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/level.h (original)
+++ logging/log4cxx/trunk/include/log4cxx/level.h Wed May 23 09:29:08 2007
@@ -25,21 +25,6 @@
#include <log4cxx/helpers/objectptr.h>


-//
-// ERROR and DEBUG may be defined by Microsoft Platform headers and will
conflict
-// with the defintion of log4cxx::Level::ERROR and log4cxx::Level::DEBUG
below.
-// log4cxx::level::getError() can be used in place of
log4cxx::Level::ERROR.
-#if defined(ERROR)
-#define LOGCXX_PLATFORM_ERROR ERROR
-#undef ERROR
-#endif
-
-#if defined(DEBUG)
-#define LOGCXX_PLATFORM_DEBUG DEBUG
-#undef DEBUG
-#endif
-
-
namespace log4cxx
{
class Level;
@@ -129,43 +114,6 @@
ALL_INT = INT_MIN
};

- /**
- The <code>ALL</code> level designates all the levels
- */
- static const LevelPtr ALL;
-
- /**
- The <code>FATAL</code> level designates very severe error
- events that will presumably lead the application to abort.
- */
- static const LevelPtr FATAL;
-
- /**
- The <code>ERROR</code> level designates error events that
- might still allow the application to continue running. */
- static const LevelPtr ERROR;
-
- /**
- The <code>WARN</code> level designates potentially harmful
situations.
- */
- static const LevelPtr WARN;
-
- /**
- The <code>INFO</code> level designates informational messages
- that highlight the progress of the application at
coarse-grained
- level. */
- static const LevelPtr INFO;
-
- /**
- The <code>DEBUG</code> level designates fine-grained
- informational events that are most useful to debug an
- application. */
- static const LevelPtr DEBUG;
-
- /**
- The <code>OFF</code> level designates not set level
- */
- static const LevelPtr OFF;

static const LevelPtr& getAll();
static const LevelPtr& getFatal();

Modified: logging/log4cxx/trunk/include/log4cxx/logger.h
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/logger.h?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/logger.h (original)
+++ logging/log4cxx/trunk/include/log4cxx/logger.h Wed May 23 09:29:08 2007
@@ -647,7 +647,7 @@
*/
#define LOG4CXX_INFO(logger, message) { \
if (logger->isInfoEnabled()) {\
- logger->forcedLog(::log4cxx::Level::INFO, message,
LOG4CXX_LOCATION); }}
+ logger->forcedLog(::log4cxx::Level::getInfo(), message,
LOG4CXX_LOCATION); }}

/**
Logs a message to a specified logger with the WARN level.
@@ -657,7 +657,7 @@
*/
#define LOG4CXX_WARN(logger, message) { \
if (logger->isWarnEnabled()) {\
- logger->forcedLog(::log4cxx::Level::WARN, message,
LOG4CXX_LOCATION); }}
+ logger->forcedLog(::log4cxx::Level::getWarn(), message,
LOG4CXX_LOCATION); }}

/**
Logs a message to a specified logger with the ERROR level.
@@ -689,7 +689,7 @@
*/
#define LOG4CXX_FATAL(logger, message) { \
if (logger->isFatalEnabled()) {\
- logger->forcedLog(::log4cxx::Level::FATAL, message,
LOG4CXX_LOCATION); }}
+ logger->forcedLog(::log4cxx::Level::getFatal(), message,
LOG4CXX_LOCATION); }}

/**
Logs a localized message with no parameter.

Modified: logging/log4cxx/trunk/include/log4cxx/spi/loggerrepository.h
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/include/log4cxx/spi/loggerrepository.h?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/include/log4cxx/spi/loggerrepository.h (original)
+++ logging/log4cxx/trunk/include/log4cxx/spi/loggerrepository.h Wed May 23
09:29:08 2007
@@ -75,7 +75,7 @@
/**
Set the repository-wide threshold. All logging requests below
the
threshold are immediately dropped. By default, the threshold is
- set to <code>Level::ALL</code> which has the lowest possible
rank. */
+ set to <code>Level::getAll()</code> which has the lowest
possible rank. */
virtual void setThreshold(const LevelPtr& level) = 0;

/**

Modified: logging/log4cxx/trunk/performance/main.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/performance/main.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/performance/main.cpp (original)
+++ logging/log4cxx/trunk/performance/main.cpp Wed May 23 09:29:08 2007
@@ -53,7 +53,7 @@
static int main(std::vector<LogString>& args) {
LoggerPtr j(Logger::getLogger("org.apache.log4j.joran"));
j->setAdditivity(false);
- j->setLevel(Level::WARN);
+ j->setLevel(Level::getWarn());
AppenderPtr a(new ConsoleAppender());
a->setLayout(new PatternLayout(LOG4CXX_STR("%d %level %c - %m%n")));
a->setName(LOG4CXX_STR("console"));
@@ -142,7 +142,7 @@
static long loopStream(long len, LoggerPtr& logger1) {
const char* msg = "Some fix message of medium length.";
apr_time_t before = apr_time_now();
- logstream ls(logger1, Level::DEBUG);
+ logstream ls(logger1, Level::getDebug());
for (int i = 0; i < len; i++) {
ls << msg << LOG4CXX_ENDMSG;
}
@@ -153,7 +153,7 @@
static long loopWideStream(long len, LoggerPtr& logger1) {
const wchar_t* msg = L"Some fix message of medium length.";
apr_time_t before = apr_time_now();
- logstream ls(logger1, Level::DEBUG);
+ logstream ls(logger1, Level::getDebug());
for (int i = 0; i < len; i++) {
ls << msg << LOG4CXX_ENDMSG;
}
@@ -165,7 +165,7 @@
const char* msg = "Some fix message of medium length.";
apr_time_t before = apr_time_now();
for (int i = 0; i < len; i++) {
- logstream ls(logger1, Level::DEBUG);
+ logstream ls(logger1, Level::getDebug());
ls << msg << LOG4CXX_ENDMSG;
}
return (apr_time_now() - before) / 1000;
@@ -176,7 +176,7 @@
const wchar_t* msg = L"Some fix message of medium length.";
apr_time_t before = apr_time_now();
for (int i = 0; i < len; i++) {
- logstream ls(logger1, Level::DEBUG);
+ logstream ls(logger1, Level::getDebug());
ls << msg << LOG4CXX_ENDMSG;
}
return (apr_time_now() - before) / 1000;

Modified: logging/log4cxx/trunk/simplesocketserver/simplesocketserver.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/simplesocketserver/simplesocketserver.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/simplesocketserver/simplesocketserver.cpp (original)
+++ logging/log4cxx/trunk/simplesocketserver/simplesocketserver.cpp Wed May 23
09:29:08 2007
@@ -85,7 +85,7 @@
try
{
LoggerPtr logger = Logger::getLogger("SimpleSocketServer");
- log4cxx::logstream logstream(logger, Level::INFO);
+ log4cxx::logstream logstream(logger, Level::getInfo());

logstream << "Listening on port " << port;


Modified: logging/log4cxx/trunk/src/level.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/level.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/src/level.cpp (original)
+++ logging/log4cxx/trunk/src/level.cpp Wed May 23 09:29:08 2007
@@ -199,18 +199,3 @@
}
#endif

-//
-// may be declared by some platform headers
-//
-#undef ERROR
-#undef DEBUG
-
-const LevelPtr Level::OFF(Level::getOff());
-const LevelPtr Level::FATAL(Level::getFatal());
-const LevelPtr Level::ERROR(Level::getError());
-const LevelPtr Level::WARN(Level::getWarn());
-const LevelPtr Level::INFO(Level::getInfo());
-const LevelPtr Level::DEBUG(Level::getDebug());
-const LevelPtr Level::ALL(Level::getAll());
-
-

Modified: logging/log4cxx/trunk/src/smtpappender.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/smtpappender.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/src/smtpappender.cpp (original)
+++ logging/log4cxx/trunk/src/smtpappender.cpp Wed May 23 09:29:08 2007
@@ -39,7 +39,7 @@

bool DefaultEvaluator::isTriggeringEvent(const spi::LoggingEventPtr& event)
{
- return event->getLevel()->isGreaterOrEqual(Level::ERROR);
+ return event->getLevel()->isGreaterOrEqual(Level::getError());
}

SMTPAppender::SMTPAppender()

Modified: logging/log4cxx/trunk/tests/src/appenderskeletontestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/appenderskeletontestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/appenderskeletontestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/appenderskeletontestcase.cpp Wed May 23
09:29:08 2007
@@ -28,12 +28,12 @@
void AppenderSkeletonTestCase::testDefaultThreshold() {
ObjectPtrT<AppenderSkeleton> appender(createAppenderSkeleton());
LevelPtr threshold(appender->getThreshold());
- CPPUNIT_ASSERT_EQUAL(Level::ALL->toInt(), threshold->toInt());
+ CPPUNIT_ASSERT_EQUAL(Level::getAll()->toInt(), threshold->toInt());
}

void AppenderSkeletonTestCase::testSetOptionThreshold() {
ObjectPtrT<AppenderSkeleton> appender(createAppenderSkeleton());
appender->setOption(LOG4CXX_STR("threshold"), LOG4CXX_STR("debug"));
LevelPtr threshold(appender->getThreshold());
- CPPUNIT_ASSERT_EQUAL(Level::DEBUG->toInt(), threshold->toInt());
+ CPPUNIT_ASSERT_EQUAL(Level::getDebug()->toInt(), threshold->toInt());
}

Modified: logging/log4cxx/trunk/tests/src/encodingtest.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/encodingtest.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/encodingtest.cpp (original)
+++ logging/log4cxx/trunk/tests/src/encodingtest.cpp Wed May 23 09:29:08 2007
@@ -143,7 +143,7 @@
appender->setLayout(layout);
appender->activateOptions(p);
logger->addAppender(appender);
- logger->setLevel(Level::INFO);
+ logger->setLevel(Level::getInfo());
}

/**

Modified: logging/log4cxx/trunk/tests/src/helpers/cyclicbuffertestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/helpers/cyclicbuffertestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/helpers/cyclicbuffertestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/helpers/cyclicbuffertestcase.cpp Wed May 23
09:29:08 2007
@@ -50,7 +50,7 @@
LoggingEventPtr event;
for (int i = 0; i < MAX; i++)
{
- event = new LoggingEvent(logger, Level::DEBUG, LOG4CXX_STR("e"),
+ event = new LoggingEvent(logger, Level::getDebug(), LOG4CXX_STR("e"),

log4cxx::spi::LocationInfo::getLocationUnavailable());
e.push_back(event);
}

Modified: logging/log4cxx/trunk/tests/src/l7dtestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/l7dtestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/l7dtestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/l7dtestcase.cpp Wed May 23 09:29:08 2007
@@ -82,20 +82,20 @@
{
root->setResourceBundle(bundles[i]);

- LOG4CXX_L7DLOG(root, Level::DEBUG,
LOG4CXX_TEST_STR("bogus1"));
- LOG4CXX_L7DLOG(root, Level::INFO,
LOG4CXX_TEST_STR("test"));
- LOG4CXX_L7DLOG(root, Level::WARN,
LOG4CXX_TEST_STR("hello_world"));
+ LOG4CXX_L7DLOG(root, Level::getDebug(),
LOG4CXX_TEST_STR("bogus1"));
+ LOG4CXX_L7DLOG(root, Level::getInfo(),
LOG4CXX_TEST_STR("test"));
+ LOG4CXX_L7DLOG(root, Level::getWarn(),
LOG4CXX_TEST_STR("hello_world"));


StringBuffer os;
os << (i + 1);
- LOG4CXX_L7DLOG2(root, Level::DEBUG,
LOG4CXX_TEST_STR("msg1"), os.str().c_str(),
+ LOG4CXX_L7DLOG2(root, Level::getDebug(),
LOG4CXX_TEST_STR("msg1"), os.str().c_str(),
LOG4CXX_TEST_STR("log4j"));
LOG4CXX_L7DLOG2(root, Level::getError(),
LOG4CXX_TEST_STR("bogusMsg"), os.str().c_str(),
LOG4CXX_TEST_STR("log4j"));
LOG4CXX_L7DLOG2(root, Level::getError(),
LOG4CXX_TEST_STR("msg1"), os.str().c_str(),
LOG4CXX_TEST_STR("log4j"));
- LOG4CXX_L7DLOG(root, Level::INFO,
LOG4CXX_TEST_STR("bogus2"));
+ LOG4CXX_L7DLOG(root, Level::getInfo(),
LOG4CXX_TEST_STR("bogus2"));
}

CPPUNIT_ASSERT(Compare::compare(LOG4CXX_FILE("output/temp"),

Modified: logging/log4cxx/trunk/tests/src/loggertestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/loggertestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/loggertestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/loggertestcase.cpp Wed May 23 09:29:08 2007
@@ -226,59 +226,59 @@
LoggerRepositoryPtr h = LogManager::getLoggerRepository();

//h.disableDebug();
- h->setThreshold(Level::INFO);
+ h->setThreshold(Level::getInfo());
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 0);

root->debug(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 0);
root->info(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 1);
- root->log(Level::WARN, MSG);
+ root->log(Level::getWarn(), MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 2);
root->warn(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 3);

//h.disableInfo();
- h->setThreshold(Level::WARN);
+ h->setThreshold(Level::getWarn());
root->debug(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 3);
root->info(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 3);
- root->log(Level::WARN, MSG);
+ root->log(Level::getWarn(), MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 4);
root->error(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 5);
- root->log(Level::ERROR, MSG);
+ root->log(Level::getError(), MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);

//h.disableAll();
- h->setThreshold(Level::OFF);
+ h->setThreshold(Level::getOff());
root->debug(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->info(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
- root->log(Level::WARN, MSG);
+ root->log(Level::getWarn(), MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->error(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
- root->log(Level::FATAL, MSG);
+ root->log(Level::getFatal(), MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
- root->log(Level::FATAL, MSG);
+ root->log(Level::getFatal(), MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);

//h.disable(Level::getFatalLevel());
- h->setThreshold(Level::OFF);
+ h->setThreshold(Level::getOff());
root->debug(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->info(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
- root->log(Level::WARN, MSG);
+ root->log(Level::getWarn(), MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
root->error(MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
- root->log(Level::WARN, MSG);
+ root->log(Level::getWarn(), MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
- root->log(Level::FATAL, MSG);
+ root->log(Level::getFatal(), MSG);
CPPUNIT_ASSERT_EQUAL(caRoot->counter, 6);
}

@@ -392,7 +392,7 @@
LoggerPtr a0 = h->getLogger(LOG4CXX_STR("a"));
CPPUNIT_ASSERT_EQUAL((LogString) LOG4CXX_STR("a"),
a0->getName());
CPPUNIT_ASSERT(a0->getLevel() == 0);
- CPPUNIT_ASSERT(Level::ERROR == a0->getEffectiveLevel());
+ CPPUNIT_ASSERT(Level::getError() == a0->getEffectiveLevel());

LoggerPtr a11 = h->getLogger(LOG4CXX_STR("a"));
CPPUNIT_ASSERT_EQUAL(a0, a11);

Modified: logging/log4cxx/trunk/tests/src/minimumtestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/minimumtestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/minimumtestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/minimumtestcase.cpp Wed May 23 09:29:08 2007
@@ -132,13 +132,13 @@
ERRlogger->setLevel(Level::getError());

LoggerPtr INF = Logger::getLogger(LOG4CXX_TEST_STR("INF"));
- INF->setLevel(Level::INFO);
+ INF->setLevel(Level::getInfo());

LoggerPtr INF_ERR =
Logger::getLogger(LOG4CXX_TEST_STR("INF.ERR"));
INF_ERR->setLevel(Level::getError());

LoggerPtr DEB = Logger::getLogger(LOG4CXX_TEST_STR("DEB"));
- DEB->setLevel(Level::DEBUG);
+ DEB->setLevel(Level::getDebug());

// Note: categories with undefined level
LoggerPtr INF_UNDEF =
Logger::getLogger(LOG4CXX_TEST_STR("INF.UNDEF"));

Modified: logging/log4cxx/trunk/tests/src/nt/nteventlogappendertestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/nt/nteventlogappendertestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/nt/nteventlogappendertestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/nt/nteventlogappendertestcase.cpp Wed May
23 09:29:08 2007
@@ -79,7 +79,7 @@
LoggerPtr logger(Logger::getLogger("org.foobar"));

LoggingEventPtr event(new LoggingEvent(
- logger, Level::INFO, LOG4CXX_STR("Hello, World"),
LOG4CXX_LOCATION));
+ logger, Level::getInfo(), LOG4CXX_STR("Hello, World"),
LOG4CXX_LOCATION));
appender->doAppend(event, p);
}
hEventLog = ::OpenEventLogW(NULL, L"log4cxx_test");

Modified: logging/log4cxx/trunk/tests/src/pattern/patternparsertestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/pattern/patternparsertestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/pattern/patternparsertestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/pattern/patternparsertestcase.cpp Wed May
23 09:29:08 2007
@@ -84,7 +84,7 @@
logger = Logger::getLogger(LOG4CXX_TEST_STR("org.foobar"));

event = new LoggingEvent(
- logger, Level::INFO, LOG4CXX_STR("msg 1"), LOG4CXX_LOCATION);
+ logger, Level::getInfo(), LOG4CXX_STR("msg 1"), LOG4CXX_LOCATION);
}

void tearDown()

Modified: logging/log4cxx/trunk/tests/src/patternlayouttest.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/patternlayouttest.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/patternlayouttest.cpp (original)
+++ logging/log4cxx/trunk/tests/src/patternlayouttest.cpp Wed May 23 09:29:08
2007
@@ -446,7 +446,7 @@

// set appender on root and set level to debug
root->addAppender(appender);
- root->setLevel(Level::DEBUG);
+ root->setLevel(Level::getDebug());

// output starting message
root->debug(LOG4CXX_TEST_STR("starting mdc pattern test"));

Modified: logging/log4cxx/trunk/tests/src/rolling/filterbasedrollingtest.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/rolling/filterbasedrollingtest.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/rolling/filterbasedrollingtest.cpp
(original)
+++ logging/log4cxx/trunk/tests/src/rolling/filterbasedrollingtest.cpp Wed May
23 09:29:08 2007
@@ -79,7 +79,7 @@
FilterBasedTriggeringPolicyPtr fbtp(new FilterBasedTriggeringPolicy());

LevelRangeFilterPtr rf(new LevelRangeFilter());
- rf->setLevelMin(Level::INFO);
+ rf->setLevelMin(Level::getInfo());
fbtp->addFilter(rf);

Pool p;
@@ -96,7 +96,7 @@
rfa->setTriggeringPolicy(fbtp);
rfa->activateOptions(p);
Logger::getRootLogger()->addAppender(rfa);
- Logger::getRootLogger()->setLevel(Level::DEBUG);
+ Logger::getRootLogger()->setLevel(Level::getDebug());

common(LOG4CXX_STR("output/filterBased-test2"));
}

Modified: logging/log4cxx/trunk/tests/src/streamtestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/streamtestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/streamtestcase.cpp (original)
+++ logging/log4cxx/trunk/tests/src/streamtestcase.cpp Wed May 23 09:29:08 2007
@@ -84,21 +84,21 @@

void testConstructor() {
LoggerPtr root(Logger::getRootLogger());
- log4cxx::logstream stream(root, log4cxx::Level::INFO);
+ log4cxx::logstream stream(root, log4cxx::Level::getInfo());
CPPUNIT_ASSERT_EQUAL(0, (int) stream.width());
CPPUNIT_ASSERT_EQUAL(6, (int) stream.precision());
}

void testSimple() {
LoggerPtr root(Logger::getRootLogger());
- log4cxx::logstream stream(root, log4cxx::Level::INFO);
+ log4cxx::logstream stream(root, log4cxx::Level::getInfo());
stream << "This is a test" << LOG4CXX_ENDMSG;
CPPUNIT_ASSERT_EQUAL((size_t) 1,
vectorAppender->getVector().size());
}

void testSimpleWithFlush() {
LoggerPtr root(Logger::getRootLogger());
- log4cxx::logstream stream(root, log4cxx::Level::INFO);
+ log4cxx::logstream stream(root, log4cxx::Level::getInfo());
stream << "This is a test\n";
stream.flush();
CPPUNIT_ASSERT_EQUAL((size_t) 1,
vectorAppender->getVector().size());
@@ -106,14 +106,14 @@

void testSimpleWithoutFlush() {
LoggerPtr root(Logger::getRootLogger());
- log4cxx::logstream stream(root, log4cxx::Level::INFO);
+ log4cxx::logstream stream(root, log4cxx::Level::getInfo());
stream << "This is a test\n";
CPPUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
}

void testMultiple() {
LoggerPtr root(Logger::getRootLogger());
- log4cxx::logstream stream(root, log4cxx::Level::INFO);
+ log4cxx::logstream stream(root, log4cxx::Level::getInfo());
stream << "This is a test" << LOG4CXX_ENDMSG;
stream << "This is another test message" << LOG4CXX_ENDMSG;
CPPUNIT_ASSERT_EQUAL((size_t) 2,
vectorAppender->getVector().size());
@@ -121,8 +121,8 @@

void testShortCircuit() {
LoggerPtr logger(Logger::getLogger("StreamTestCase.shortCircuit"));
- logger->setLevel(log4cxx::Level::INFO);
- log4cxx::logstream stream(logger, log4cxx::Level::DEBUG);
+ logger->setLevel(log4cxx::Level::getInfo());
+ log4cxx::logstream stream(logger, log4cxx::Level::getDebug());
ExceptionOnInsert someObj;
stream << someObj << LOG4CXX_ENDMSG;
CPPUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
@@ -130,7 +130,7 @@

void testScientific() {
LoggerPtr root(Logger::getRootLogger());
- log4cxx::logstream stream(root, log4cxx::Level::INFO);
+ log4cxx::logstream stream(root, log4cxx::Level::getInfo());
stream //<< std::scientific
<< 0.000001115
<< LOG4CXX_ENDMSG;
@@ -142,7 +142,7 @@

void testPrecision() {
LoggerPtr root(Logger::getRootLogger());
- log4cxx::logstream stream(root, log4cxx::Level::INFO);
+ log4cxx::logstream stream(root, log4cxx::Level::getInfo());
stream.precision(4);
stream << std::fixed
<< 1.000001
@@ -155,7 +155,7 @@

void testWidth() {
LoggerPtr root(Logger::getRootLogger());
- log4cxx::logstream stream(root, log4cxx::Level::INFO);
+ log4cxx::logstream stream(root, log4cxx::Level::getInfo());
stream.width(5);
stream.precision(2);
stream << std::fixed
@@ -178,7 +178,7 @@

void testGetStream() {
LoggerPtr root(Logger::getRootLogger());
- log4cxx::logstream stream(root, log4cxx::Level::INFO);
+ log4cxx::logstream stream(root, log4cxx::Level::getInfo());
addMessage(stream.getStream());
stream << LOG4CXX_ENDMSG;
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
@@ -189,8 +189,8 @@

void testGetStreamDebug() {
LoggerPtr logger(Logger::getLogger("StreamTestCase.getStreamDebug"));
- logger->setLevel(log4cxx::Level::INFO);
- log4cxx::logstream stream(logger, log4cxx::Level::DEBUG);
+ logger->setLevel(log4cxx::Level::getInfo());
+ log4cxx::logstream stream(logger, log4cxx::Level::getDebug());
addMessage(stream.getStream());
stream << LOG4CXX_ENDMSG;
CPPUNIT_ASSERT_EQUAL((size_t) 0, vectorAppender->getVector().size());
@@ -199,10 +199,10 @@

void testInsertLevel() {
LoggerPtr logger(Logger::getLogger("StreamTestCase.insertLevel"));
- logger->setLevel(log4cxx::Level::INFO);
- log4cxx::logstream stream(logger, log4cxx::Level::DEBUG);
+ logger->setLevel(log4cxx::Level::getInfo());
+ log4cxx::logstream stream(logger, log4cxx::Level::getDebug());
stream
- << log4cxx::Level::WARN
+ << log4cxx::Level::getWarn()
<< "This message must get through"
<< LOG4CXX_ENDMSG;
CPPUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
@@ -210,7 +210,7 @@

void testInsertLocation() {
LoggerPtr logger(Logger::getRootLogger());
- log4cxx::logstream stream(logger, log4cxx::Level::DEBUG);
+ log4cxx::logstream stream(logger, log4cxx::Level::getDebug());
stream << LOG4CXX_LOCATION;
}


Modified: logging/log4cxx/trunk/tests/src/varia/levelmatchfiltertestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/varia/levelmatchfiltertestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/varia/levelmatchfiltertestcase.cpp
(original)
+++ logging/log4cxx/trunk/tests/src/varia/levelmatchfiltertestcase.cpp Wed May
23 09:29:08 2007
@@ -79,10 +79,10 @@

// set appender on root and set level to debug
root->addAppender(appender);
- root->setLevel(Level::DEBUG);
+ root->setLevel(Level::getDebug());

LevelPtr levelArray[] =
- { Level::DEBUG, Level::INFO, Level::WARN,
Level::getError(), Level::FATAL };
+ { Level::getDebug(), Level::getInfo(),
Level::getWarn(), Level::getError(), Level::getFatal() };

int length = sizeof(levelArray)/sizeof(levelArray[0]);

@@ -117,10 +117,10 @@

// set appender on root and set level to debug
root->addAppender(appender);
- root->setLevel(Level::DEBUG);
+ root->setLevel(Level::getDebug());

LevelPtr levelArray[] =
- { Level::DEBUG, Level::INFO, Level::WARN,
Level::getError(), Level::FATAL };
+ { Level::getDebug(), Level::getInfo(),
Level::getWarn(), Level::getError(), Level::getFatal() };

int length = sizeof(levelArray)/sizeof(levelArray[0]);


Modified: logging/log4cxx/trunk/tests/src/varia/levelrangefiltertestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/tests/src/varia/levelrangefiltertestcase.cpp?view=diff&rev=540989&r1=540988&r2=540989
==============================================================================
--- logging/log4cxx/trunk/tests/src/varia/levelrangefiltertestcase.cpp
(original)
+++ logging/log4cxx/trunk/tests/src/varia/levelrangefiltertestcase.cpp Wed May
23 09:29:08 2007
@@ -78,7 +78,7 @@

// set appender on root and set level to debug
root->addAppender(appender);
- root->setLevel(Level::DEBUG);
+ root->setLevel(Level::getDebug());

int passCount = 0;
LogString sbuf(LOG4CXX_STR("pass "));
@@ -91,7 +91,7 @@
passCount++;

// test with a min set
- rangeFilter->setLevelMin(Level::WARN);
+ rangeFilter->setLevelMin(Level::getWarn());
sbuf.assign(LOG4CXX_STR("pass "));
sbuf.append(StringHelper::toString(passCount, pool));
sbuf.append(LOG4CXX_STR("; min set to WARN, max not set"));
@@ -104,7 +104,7 @@
appender->addFilter(rangeFilter);

//test with max set
- rangeFilter->setLevelMax(Level::WARN);
+ rangeFilter->setLevelMax(Level::getWarn());
sbuf.assign(LOG4CXX_STR("pass "));
sbuf.append(StringHelper::toString(passCount, pool));
sbuf.append(LOG4CXX_STR("; min not set, max set to WARN"));
@@ -163,7 +163,7 @@

// set appender on root and set level to debug
root->addAppender(appender);
- root->setLevel(Level::DEBUG);
+ root->setLevel(Level::getDebug());

int passCount = 0;
LogString sbuf(LOG4CXX_STR("pass "));
@@ -177,7 +177,7 @@
passCount++;

// test with a min set
- rangeFilter->setLevelMin(Level::WARN);
+ rangeFilter->setLevelMin(Level::getWarn());
sbuf.assign(LOG4CXX_STR("pass "));

sbuf.append(StringHelper::toString(passCount, pool));
@@ -191,7 +191,7 @@
appender->addFilter(rangeFilter);

//test with max set
- rangeFilter->setLevelMax(Level::WARN);
+ rangeFilter->setLevelMax(Level::getWarn());
sbuf.assign(LOG4CXX_STR("pass "));

sbuf.append(StringHelper::toString(passCount, pool));





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation