created output logger
This commit is contained in:
@@ -12,33 +12,50 @@ INITIALIZE_EASYLOGGINGPP
|
||||
#endif
|
||||
namespace LoggerFactory
|
||||
{
|
||||
void CreateInputTestLogger(el::Level level)
|
||||
{
|
||||
el::Loggers::getLogger(INPUT_LOGGER);
|
||||
el::Configurations conf;
|
||||
|
||||
conf.setToDefault();
|
||||
void CreateInputTestLogger(el::Level level)
|
||||
{
|
||||
el::Loggers::getLogger(INPUT_LOGGER);
|
||||
el::Configurations conf;
|
||||
|
||||
conf.set(level, el::ConfigurationType::ToFile, "false");
|
||||
conf.set(level, el::ConfigurationType::Format, "%datetime [%level] [%func] : %msg");
|
||||
conf.setToDefault();
|
||||
|
||||
el::Loggers::reconfigureAllLoggers(conf);
|
||||
}
|
||||
conf.set(level, el::ConfigurationType::ToFile, "false");
|
||||
conf.set(level, el::ConfigurationType::Format, "%datetime [%level] [%func] : %msg");
|
||||
|
||||
void CreateInputLogger(el::Level level)
|
||||
{
|
||||
el::Loggers::getLogger(INPUT_LOGGER);
|
||||
el::Loggers::reconfigureAllLoggers(conf);
|
||||
}
|
||||
|
||||
el::Configurations conf;
|
||||
conf.setToDefault();
|
||||
el::Configurations createConfig(el::Level level)
|
||||
{
|
||||
el::Configurations conf;
|
||||
conf.setToDefault();
|
||||
|
||||
conf.setGlobally(el::ConfigurationType::ToStandardOutput, "false");
|
||||
conf.setGlobally(el::ConfigurationType::ToStandardOutput, "false");
|
||||
|
||||
conf.set(level, el::ConfigurationType::ToStandardOutput, "true");
|
||||
conf.set(level, el::ConfigurationType::ToFile, "true");
|
||||
conf.set(level, el::ConfigurationType::Filename, LOGGER_FILE);
|
||||
conf.set(level, el::ConfigurationType::Format, "%datetime [%level] [%func] : %msg");
|
||||
conf.set(level, el::ConfigurationType::ToStandardOutput, "true");
|
||||
conf.set(level, el::ConfigurationType::ToFile, "true");
|
||||
conf.set(level, el::ConfigurationType::Filename, LOGGER_FILE);
|
||||
conf.set(level, el::ConfigurationType::Format, "%datetime [%level] [%func] : %msg");
|
||||
|
||||
return conf;
|
||||
}
|
||||
void CreateInputLogger(el::Level level)
|
||||
{
|
||||
el::Loggers::getLogger(INPUT_LOGGER);
|
||||
|
||||
el::Configurations conf = createConfig(level);
|
||||
|
||||
el::Loggers::reconfigureLogger(INPUT_LOGGER, conf);
|
||||
}
|
||||
|
||||
void CreateOutputLogger(el::Level level)
|
||||
{
|
||||
el::Loggers::getLogger(OUTPUT_LOGGER);
|
||||
|
||||
el::Configurations conf = createConfig(level);
|
||||
|
||||
el::Loggers::reconfigureLogger(OUTPUT_LOGGER, conf);
|
||||
}
|
||||
|
||||
el::Loggers::reconfigureLogger(INPUT_LOGGER, conf);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace LoggerFactory
|
||||
void CreateInputTestLogger(el::Level level = el::Level::Global);
|
||||
|
||||
void CreateInputLogger(el::Level level = el::Level::Info);
|
||||
|
||||
void CreateOutputLogger(el::Level level = el::Level::Info);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -10,7 +10,8 @@
|
||||
#define INPUT_LOGGER "driver_logger"
|
||||
#define OUTPUT_LOGGER "output_logger"
|
||||
|
||||
#define LOGGER_FILE "input_driver.log"
|
||||
#define LOGGER_FILE "driver.log"
|
||||
|
||||
|
||||
|
||||
#define DRIVER_CONF_FILE "/var/log/flippr_driver.conf"
|
||||
|
||||
Reference in New Issue
Block a user