This commit is contained in:
2021-08-28 13:43:59 +02:00
parent 84d5c5fa74
commit e20021dd2d
2 changed files with 6 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
config usbserial config capture
option port /dev/ttyUSB0 option port /dev/ttyUSB0
option speed 115200 option speed 115200
option directory /tmp option directory /tmp

View File

@@ -53,17 +53,6 @@ enum severity_level
BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", severity_level) BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", severity_level)
bool dataHandler(unsigned long blockNo, char* buffer, int size)
{
cout << "Block No. = " << blockNo << endl;
for (int i=0 ; i<size ; i++) {
cout << char(buffer[i]) << " ";
}
cout << endl;
return true;
}
static void init_log(void) static void init_log(void)
{ {
/* init boost log /* init boost log
@@ -98,7 +87,11 @@ static void init_log(void)
/* console sink */ /* console sink */
auto consoleSink = boost::log::add_console_log(std::clog); auto consoleSink = boost::log::add_console_log(std::clog);
consoleSink->set_formatter(logFmt); consoleSink->set_formatter(logFmt);
consoleSink->set_filter(severity >= warning); consoleSink->set_filter(
boost::log::trivial::severity >= boost::log::trivial::warning
);
/* fs sink */ /* fs sink */
auto fsSink = boost::log::add_file_log( auto fsSink = boost::log::add_file_log(
// boost::log::keywords::file_name = "serial-dw_%Y-%m-%d_%H-%M-%S.%N.log", // boost::log::keywords::file_name = "serial-dw_%Y-%m-%d_%H-%M-%S.%N.log",