aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Nehls <nehls@mi.fu-berlin.de>2010-01-22 18:53:31 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:45 +0100
commitc2b751f45721e9dabe5c1dc59a536cb537aaa9b5 (patch)
treedc6d3928fe378c6b17ab64b672f6fdae01e3ccbc
parentf2aac90b341038e00b4bfb028317de89b792cb24 (diff)
downloadusdx-c2b751f45721e9dabe5c1dc59a536cb537aaa9b5.tar.gz
usdx-c2b751f45721e9dabe5c1dc59a536cb537aaa9b5.tar.xz
usdx-c2b751f45721e9dabe5c1dc59a536cb537aaa9b5.zip
Added possibility to easyly disable logging
for functions with are designed to throw exeptions for example
Diffstat (limited to '')
-rw-r--r--test/base/songloading.cpp10
1 files changed, 10 insertions, 0 deletions
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 <cppunit/extensions/HelperMacros.h>
#include "song.hpp"
#include "songloading/songloader.hpp"
+#include <log4cxx/logger.h>
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()