From 53bd23d0e679746b78d0bcf9234e7b99983e6071 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 29 Nov 2011 04:52:52 +0100 Subject: ported from log4cxx to log4cpp log4cxx depends on Apache Portable Runtime Utility Library, so we switch to log4cpp with nearly the same features but with no dependencies for easier porting to other platforms --- test/base/songloading.cpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'test/base/songloading.cpp') diff --git a/test/base/songloading.cpp b/test/base/songloading.cpp index ddb2756f..94690cc3 100644 --- a/test/base/songloading.cpp +++ b/test/base/songloading.cpp @@ -28,7 +28,8 @@ #include #include "song.hpp" #include "songloading/songloader.hpp" -#include +#include +#include namespace usdx { @@ -42,21 +43,19 @@ namespace usdx CPPUNIT_TEST_SUITE_END(); private: - int oldLogLevel; + log4cpp::Priority::Value oldLogLevel; public: void setUp() { // save old loglevel in case we want to disable logging - using namespace log4cxx; - oldLogLevel = Logger::getRootLogger()->getEffectiveLevel()->toInt(); + oldLogLevel = log4cpp::Category::getRoot().getPriority(); } void tearDown() { // set old loglevel in case we did disable logging - using namespace log4cxx; - Logger::getRootLogger()->setLevel(Level::toLevel(oldLogLevel)); + log4cpp::Category::getRoot().setPriority(oldLogLevel); } void testSongloadingTxtHeader() @@ -93,8 +92,7 @@ namespace usdx { // disable logging to avoid logmsgs when the exeption // is thrown - using namespace log4cxx; - Logger::getRootLogger()->setLevel(Level::getOff()); + log4cpp::Category::getRoot().setPriority(log4cpp::Priority::EMERG); Songloader::get_instance()-> load_header("testdata/testsong_missing_artist.txt"); @@ -104,8 +102,7 @@ namespace usdx { // disable logging to avoid logmsgs when the exeption // is thrown - using namespace log4cxx; - Logger::getRootLogger()->setLevel(Level::getOff()); + log4cpp::Category::getRoot().setPriority(log4cpp::Priority::EMERG); Songloader::get_instance()-> load_header("testdata/testsong_missing_title.txt"); @@ -115,8 +112,7 @@ namespace usdx { // disable logging to avoid logmsgs when the exeption // is thrown - using namespace log4cxx; - Logger::getRootLogger()->setLevel(Level::getOff()); + log4cpp::Category::getRoot().setPriority(log4cpp::Priority::EMERG); Songloader::get_instance()-> load_header("testdata/testsong_missing_mp3.txt"); @@ -127,8 +123,7 @@ namespace usdx { // disable logging to avoid logmsgs when the exeption // is thrown - using namespace log4cxx; - Logger::getRootLogger()->setLevel(Level::getOff()); + log4cpp::Category::getRoot().setPriority(log4cpp::Priority::EMERG); Songloader::get_instance()-> load_header("testdata/testsong_missing_bpm.txt"); -- cgit v1.2.3