configured logger
This commit is contained in:
@@ -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