summaryrefslogtreecommitdiff
path: root/test/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-04-09 22:15:25 +0000
committerChris Wilson <chris+github@qwirx.com>2014-04-09 22:15:25 +0000
commite0d11ae476981fd56229b4ccffdd30166361548b (patch)
tree1454c0ef13ea79acc495f10ca79de31ee613e9ab /test/bbackupd
parentcd45df502bf91e550692d9930c6aaffc137eaadf (diff)
Remove the global logging level.
It's incompatible with having a logger that logs everything, regardless of the global log level.
Diffstat (limited to 'test/bbackupd')
-rw-r--r--test/bbackupd/testbbackupd.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp
index 28651233..827e3ea0 100644
--- a/test/bbackupd/testbbackupd.cpp
+++ b/test/bbackupd/testbbackupd.cpp
@@ -324,7 +324,7 @@ int test_basics()
BackupClientFileAttributes t3;
{
- Logging::Guard guard(Log::ERROR);
+ Logger::LevelGuard(Logging::GetConsole(), Log::ERROR);
TEST_CHECK_THROWS(t3.ReadAttributes("doesn't exist"),
CommonException, OSFileError);
}
@@ -345,7 +345,7 @@ int test_basics()
#ifndef WIN32
{
- Logging::Guard guard(Log::ERROR);
+ Logger::LevelGuard(Logging::GetConsole(), Log::ERROR);
TEST_CHECK_THROWS(t1.WriteAttributes("testfiles/test1_nXX"),
CommonException, OSFileError);
TEST_CHECK_THROWS(t3.WriteAttributes("doesn't exist"),
@@ -879,7 +879,7 @@ int test_bbackupd()
context, 0 /* read-write */);
{
- Logging::Guard guard(Log::ERROR);
+ Logger::LevelGuard(Logging::GetConsole(), Log::ERROR);
TEST_CHECK_THROWS(ReadDirectory(*client, 0x12345678),
ConnectionException,
Conn_Protocol_UnexpectedReply);
@@ -1713,11 +1713,6 @@ int test_bbackupd()
// in fork child
TEST_THAT(setsid() != -1);
- if (!Logging::IsEnabled(Log::TRACE))
- {
- Logging::SetGlobalLevel(Log::NOTHING);
- }
-
// BackupStoreDaemon must be destroyed before exit(),
// to avoid memory leaks being reported.
{
@@ -1742,15 +1737,14 @@ int test_bbackupd()
::signal(SIGPIPE, SIG_IGN);
{
- Log::Level newLevel = Logging::GetGlobalLevel();
+ Console& console(Logging::GetConsole());
+ Logger::LevelGuard guard(console);
- if (!Logging::IsEnabled(Log::TRACE))
+ if (console.GetLevel() < Log::TRACE)
{
- newLevel = Log::NOTHING;
+ console.Filter(Log::NOTHING);
}
- Logging::Guard guard(newLevel);
-
BackupDaemon bbackupd;
bbackupd.Configure("testfiles/bbackupd.conf");
bbackupd.InitCrypto();
@@ -3424,7 +3418,8 @@ int test_bbackupd()
fflush(stdout);
{
- Logging::Guard guard(Log::FATAL);
+ Logger::LevelGuard(Logging::GetConsole(),
+ Log::FATAL);
TEST_THAT(BackupClientRestore(*client,
restoredirid, "Test1",
"testfiles/no-such-path/subdir",