Files
NFD/tests/core/global-configuration.cpp
T
Steve DiBenedetto bf6a93da4e core: change logging from environment variable to configuration file-based
GlobalConfigurationFixture uses unit-tests.conf to determine default
and module specific logging levels. Logging will gracefully default to
INFO if unit-tests.conf is not found. See unit-tests.conf.sample for a
sample configuration file.

refs: #1375, #1267

Change-Id: Ib0c4eb4149748e6658f94ef1afa23ddd3072c0fa
2014-03-31 20:46:51 -06:00

36 lines
760 B
C++

/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (C) 2014 Named Data Networking Project
* See COPYING for copyright and distribution information.
*/
#include "../test-common.hpp"
#include "core/logger.hpp"
#include "mgmt/config-file.hpp"
#include <boost/filesystem.hpp>
namespace nfd {
namespace tests {
class GlobalConfigurationFixture
{
public:
GlobalConfigurationFixture()
{
const std::string filename = "unit-tests.conf";
if (boost::filesystem::exists(filename))
{
ConfigFile config;
LoggerFactory::getInstance().setConfigFile(config);
config.parse(filename, false);
}
}
};
BOOST_GLOBAL_FIXTURE(GlobalConfigurationFixture)
} // namespace tests
} // namespace nfd