Compare commits
2 Commits
4d8ab68b81
...
64a821bea1
| Author | SHA1 | Date | |
|---|---|---|---|
| 64a821bea1 | |||
| 09abf3e122 |
13
main.cpp
13
main.cpp
@@ -42,7 +42,7 @@ namespace po = boost::program_options;
|
||||
|
||||
typedef vector< string > split_vector_type;
|
||||
|
||||
static void init_log(void)
|
||||
static void init_log(bool debug = false)
|
||||
{
|
||||
/* init boost log
|
||||
* 1. Add common attributes
|
||||
@@ -89,6 +89,10 @@ static void init_log(void)
|
||||
boost::log::keywords::min_free_space = 30 * 1024 * 1024,
|
||||
boost::log::keywords::open_mode = std::ios_base::app);
|
||||
fsSink->set_formatter(logFmt);
|
||||
if (!debug)
|
||||
fsSink->set_filter(
|
||||
boost::log::trivial::severity >= boost::log::trivial::warning
|
||||
);
|
||||
fsSink->locked_backend()->auto_flush(true);
|
||||
}
|
||||
|
||||
@@ -110,12 +114,11 @@ int main(int argc, char* argv[])
|
||||
std::string port,path,filename;
|
||||
int speed;
|
||||
|
||||
init_log();
|
||||
|
||||
po::options_description desc("Allowed options");
|
||||
desc.add_options()
|
||||
("help", "produce help message")
|
||||
("measure", "get and print values")
|
||||
("debug", "debug output to file")
|
||||
("verbose", po::value<string>()->implicit_value("0"), "verbosity level")
|
||||
("file", po::value<string>(&filename)->default_value("camera.jpg"),"filename of capture filename")
|
||||
("path", po::value<string>(&path)->default_value("/tmp"),"directory for file of capture")
|
||||
@@ -138,7 +141,9 @@ int main(int argc, char* argv[])
|
||||
cout << desc << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
init_log(vm.count("debug"));
|
||||
|
||||
} catch(std::exception& e) {
|
||||
cerr << "error: " << e.what() << "\n";
|
||||
return 1;
|
||||
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usbserial-dw
|
||||
PKG_VERSION:=0.2.4
|
||||
PKG_RELEASE:=14
|
||||
PKG_RELEASE:=15
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://git.bh.ttx.sk/jaro/usbserial-dw.git
|
||||
PKG_MIRROR_HASH:=
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=ebaf6821517af4de95b39c9398c8f77610ccc28f
|
||||
PKG_SOURCE_VERSION:=09abf3e122739988e2ca0301f7bf995665e1f56f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
|
||||
Reference in New Issue
Block a user