configured logger
This commit is contained in:
@@ -45,7 +45,7 @@ void Detector::detect()
|
||||
}
|
||||
catch(std::out_of_range& e)
|
||||
{
|
||||
CLOG(WARNING, INPUT_LOGGER) << "Did not found event for address: " << address << " check config-file";
|
||||
CLOG_N_TIMES(1, WARNING, INPUT_LOGGER) << "Did not found event for address: " << address << " check config-file";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ std::map<char, Event> InputDriverFactory::create_input_events(json matrix_config
|
||||
|
||||
void InputDriverFactory::ConfigureLogger()
|
||||
{
|
||||
LoggerFactory::CreateInputLogger();
|
||||
LoggerFactory::CreateInputTestLogger();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,17 +13,31 @@
|
||||
class LoggerFactory
|
||||
{
|
||||
public:
|
||||
static void CreateInputTestLogger()
|
||||
{
|
||||
el::Loggers::getLogger(INPUT_LOGGER);
|
||||
el::Configurations conf;
|
||||
|
||||
conf.setToDefault();
|
||||
|
||||
conf.set(el::Level::Global, el::ConfigurationType::ToFile, "false");
|
||||
conf.set(el::Level::Global, el::ConfigurationType::Format, "%datetime [%level] [%func] : %msg");
|
||||
|
||||
el::Loggers::reconfigureAllLoggers(conf);
|
||||
}
|
||||
|
||||
static void CreateInputLogger()
|
||||
{
|
||||
el::Loggers::getLogger(INPUT_LOGGER);
|
||||
el::Loggers::getLogger(INPUT_LOGGER);
|
||||
|
||||
//TODO may configure?
|
||||
el::Configurations conf;
|
||||
conf.setToDefault();
|
||||
conf.set(el::Level::Global, el::ConfigurationType::Filename, DRIVER_LOG_FILE);
|
||||
conf.set(el::Level::Global, el::ConfigurationType::Format, "%datetime [%level] [%func] : %msg");
|
||||
el::Configurations conf;
|
||||
conf.setToDefault();
|
||||
|
||||
el::Loggers::reconfigureLogger(INPUT_LOGGER, conf);
|
||||
conf.set(el::Level::Global, el::ConfigurationType::ToFile, "true");
|
||||
conf.set(el::Level::Global, el::ConfigurationType::Filename, INPUT_LOGGER_FILE);
|
||||
conf.set(el::Level::Global, el::ConfigurationType::Format, "%datetime [%level] [%func] : %msg");
|
||||
|
||||
el::Loggers::reconfigureLogger(INPUT_LOGGER, conf);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
#include "easylogging++.h"
|
||||
|
||||
#define INPUT_LOGGER "driver_logger"
|
||||
#define DRIVER_LOG_FILE "/var/log/flippr_driver.conf"
|
||||
#define INPUT_LOGGER_FILE "input_driver.log"
|
||||
|
||||
#define DRIVER_CONF_FILE "/var/log/flippr_driver.conf"
|
||||
|
||||
#define HIGH_VERBOSITY 10
|
||||
|
||||
|
||||
Reference in New Issue
Block a user