From c2b751f45721e9dabe5c1dc59a536cb537aaa9b5 Mon Sep 17 00:00:00 2001 From: Robin Nehls Date: Fri, 22 Jan 2010 18:53:31 +0100 Subject: Added possibility to easyly disable logging for functions with are designed to throw exeptions for example --- test/base/songloading.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/base/songloading.cpp b/test/base/songloading.cpp index e7595b0a..8c17d64a 100644 --- a/test/base/songloading.cpp +++ b/test/base/songloading.cpp @@ -28,6 +28,7 @@ #include #include "song.hpp" #include "songloading/songloader.hpp" +#include namespace usdx { @@ -36,13 +37,22 @@ namespace usdx CPPUNIT_TEST(testSongloadingTxtHeader); CPPUNIT_TEST_SUITE_END(); + private: + int oldLogLevel; + public: void setUp() { + // save old loglevel in case we want to disable logging + using namespace log4cxx; + oldLogLevel = Logger::getRootLogger()->getEffectiveLevel()->toInt(); } void tearDown() { + // set old loglevel in case we did disable logging + using namespace log4cxx; + Logger::getRootLogger()->setLevel(Level::toLevel(oldLogLevel)); } void testSongloadingTxtHeader() -- cgit v1.2.3