aboutsummaryrefslogtreecommitdiff
path: root/apps/sm-get-value.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-06-20 16:44:57 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-06-20 16:44:57 +0200
commitff6b859c52ad670b3db08e11209dc6833e894611 (patch)
tree694d60baf29854c0c26e98f5db134526613a3b55 /apps/sm-get-value.cpp
parentc7221b3666badbcf016e33997449e74778d979a9 (diff)
downloadble-toys-ff6b859c52ad670b3db08e11209dc6833e894611.tar.gz
ble-toys-ff6b859c52ad670b3db08e11209dc6833e894611.tar.bz2
ble-toys-ff6b859c52ad670b3db08e11209dc6833e894611.tar.xz
ble-toys-ff6b859c52ad670b3db08e11209dc6833e894611.zip
o Adding app_name to app, creating a per-app logger.
Diffstat (limited to 'apps/sm-get-value.cpp')
-rw-r--r--apps/sm-get-value.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/sm-get-value.cpp b/apps/sm-get-value.cpp
index 115c6ae..b813121 100644
--- a/apps/sm-get-value.cpp
+++ b/apps/sm-get-value.cpp
@@ -87,9 +87,13 @@ namespace apps {
class sm_get_value : public app {
public:
+ sm_get_value() : app("sm-get-value") {
+ }
+
+ ~sm_get_value() = default;
+
void add_options(po::options_description_easy_init &options) override {
- options
- ("help", "produce help message")
+ options("help", "produce help message")
("device", po::value<string>()->required(), "MAC of device to poll")
("sensor", po::value<vector<unsigned int>>(&sensors)->multitoken(), "Sensor to poll, defaults to all")
("sleep", po::value<unsigned int>(&sleepTime)->default_value(0),
@@ -123,7 +127,7 @@ public:
loop = sleepTime > 0;
do {
- cout << "Connecting to device: " << device.getMac().str() << endl;
+ LOG4CPLUS_INFO(logger, "Connecting to device: " + device.getMac().str());
auto &gatt = device.connectGatt();
try {