Changeset - 630438ec132e
[Not reviewed]
0 5 0
vitalyster - 10 years ago 2016-01-12 16:52:50
vitalyster@gmail.com
spectrum_manager: init logging
5 files changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
include/transport/Logging.h
Show inline comments
 
@@ -56,6 +56,7 @@ namespace Logging {
 

	
 
void initBackendLogging(Config *config);
 
void initMainLogging(Config *config);
 
void initManagerLogging(Config *config);
 
void shutdownLogging();
 
void redirect_stderr();
 

	
libtransport/Logging.cpp
Show inline comments
 
@@ -203,6 +203,9 @@ void initMainLogging(Config *config) {
 
	initLogging(config, "logging.config");
 
	initLogging(config, "logging.backend_config", true);
 
}
 
void initManagerLogging(Config *config) {
 
        initLogging(config, "logging.config");
 
}
 

	
 
void redirect_stderr() {
 
	 intercepter_cerr = new intercept_stream(std::cerr, "cerr");
spectrum_manager/src/managerconfig.cpp
Show inline comments
 
@@ -42,6 +42,7 @@ bool ManagerConfig::load(const std::string &configfile, boost::program_options::
 
		("database.password", value<std::string>()->default_value(""), "Database Password.")
 
		("database.port", value<int>()->default_value(0), "Database port.")
 
		("database.prefix", value<std::string>()->default_value(""), "Prefix of tables in database")
 
		("logging.config", value<std::string>()->default_value("/etc/spectrum2/logging.cfg"), "Logging configuration file")
 
	;
 

	
 
	store(parse_config_file(ifs, opts), m_variables);
spectrum_manager/src/server.cpp
Show inline comments
 
@@ -87,7 +87,8 @@ Server::Server(ManagerConfig *config, const std::string &config_file) {
 

	
 
	m_storageCfg = new Config();
 
	m_storageCfg->load(config_file);
 

	
 
	
 
	Logging::initManagerLogging(m_storageCfg);
 
	std::string error;
 
	m_storage = StorageBackend::createBackend(m_storageCfg, error);
 
	if (m_storage == NULL) {
spectrum_manager/src/server.h
Show inline comments
 
@@ -32,6 +32,7 @@
 
#include "managerconfig.h"
 

	
 
#include "transport/Config.h"
 
#include "transport/Logging.h"
 
#include "transport/SQLite3Backend.h"
 
#include "transport/MySQLBackend.h"
 
#include "transport/PQXXBackend.h"
0 comments (0 inline, 0 general)