diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-01 21:15:01 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-01 21:15:01 +0100 |
commit | e64d925b45ff4802fe924ea2e8108bb1932b4d01 (patch) | |
tree | 3f9b524c9526834b5830030562e9cb581235f2d6 /apps/sm-get-value.cpp | |
parent | 1b09c7d0547fb430e957b863bdbb3bf54c85f52a (diff) | |
download | ble-toys-e64d925b45ff4802fe924ea2e8108bb1932b4d01.tar.gz ble-toys-e64d925b45ff4802fe924ea2e8108bb1932b4d01.tar.bz2 ble-toys-e64d925b45ff4802fe924ea2e8108bb1932b4d01.tar.xz ble-toys-e64d925b45ff4802fe924ea2e8108bb1932b4d01.zip |
o Replacing boost::logging with log4cplus.
Diffstat (limited to 'apps/sm-get-value.cpp')
-rw-r--r-- | apps/sm-get-value.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/sm-get-value.cpp b/apps/sm-get-value.cpp index 14a90de..417fac7 100644 --- a/apps/sm-get-value.cpp +++ b/apps/sm-get-value.cpp @@ -1,17 +1,22 @@ #include <iostream> #include <iomanip> #include <chrono> -#include <boost/uuid/uuid_io.hpp> -#include <boost/optional.hpp> +#include <boost/log/core/core.hpp> +#include <boost/log/sinks.hpp> +#include <boost/log/trivial.hpp> #include <boost/program_options.hpp> +#include <boost/utility/empty_deleter.hpp> +#include <boost/uuid/uuid_io.hpp> #include <thread> #include "ble/Bluetooth.h" #include "SoilMoisture.h" #include "json.hpp" +#include "apps.h" // I'm lazy using namespace std; using namespace std::chrono; +using namespace trygvis::apps; using namespace trygvis::bluetooth; using namespace trygvis::soil_moisture; using json = nlohmann::json; @@ -129,6 +134,8 @@ int main(int argc, char *argv[]) { "How long to sleep in seconds between each poll. If not give, it will exit after first poll") ("format", po::value<Format>(&format)->default_value(Format::PLAIN), "Output format"); + desc.add(logging_options()); + po::variables_map vm; auto parsed = po::parse_command_line(argc, argv, desc); po::store(parsed, vm); @@ -146,6 +153,8 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } + setup_logging(vm); + __attribute__((unused)) BluetoothSystem bluetoothSystem; |