diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-11-23 16:41:24 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-11-23 16:41:24 +0100 |
commit | af416f81b14a3bee682e300b165a6efdb9739d54 (patch) | |
tree | 20c4704d5d24ed18a78970f9331aec12c9522a41 /apps/apps.cpp | |
parent | 2034b1bb10720a2f0e6cc97427346f2320c115bc (diff) | |
download | ble-toys-af416f81b14a3bee682e300b165a6efdb9739d54.tar.gz ble-toys-af416f81b14a3bee682e300b165a6efdb9739d54.tar.bz2 ble-toys-af416f81b14a3bee682e300b165a6efdb9739d54.tar.xz ble-toys-af416f81b14a3bee682e300b165a6efdb9739d54.zip |
o Trying to improve compatibility with some feature checks.
o Misc nits.
Diffstat (limited to 'apps/apps.cpp')
-rw-r--r-- | apps/apps.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/apps.cpp b/apps/apps.cpp index 56abc7b..ef0a7fc 100644 --- a/apps/apps.cpp +++ b/apps/apps.cpp @@ -53,12 +53,12 @@ const po::options_description logging_options() { return desc; } -void setup_logging(string app_name) { +void setup_logging(const string &app_name) { Appender *console = new ConsoleAppender(true, true); string pattern = "%-5p %D{%Y-%m-%d %H:%M:%S} " + app_name + "/%-20c %m%n"; // add %M (function name) - PatternLayout *layout = new PatternLayout(LOG4CPLUS_TEXT(pattern)); + auto *layout = new PatternLayout(LOG4CPLUS_TEXT(pattern)); console->setLayout(auto_ptr<Layout>(layout)); Hierarchy &h = Logger::getDefaultHierarchy(); @@ -90,7 +90,7 @@ int launch_app(app *app, int argc, const char *argv[]) { return EXIT_FAILURE; } - if (unrecognized.size()) { + if (!unrecognized.empty()) { cerr << "Unrecognized option: " << unrecognized.at(0) << "\n"; return EXIT_FAILURE; } @@ -123,5 +123,6 @@ int real_main(app *app, int argc, const char *argv[]) { return launch_app(app, argc, argv); } -} -} + +} // namespace apps +} // namespace trygvis |