summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Doukoudakis <thanos.doukoudakis@isode.com>2017-08-02 14:30:41 (GMT)
committerThanos Doukoudakis <thanos.doukoudakis@isode.com>2017-08-08 07:56:55 (GMT)
commitc5aa27ee869cc4859e494bde8ddf7da60e177f40 (patch)
tree2305ca850082c4d0565f293afced4bc47be40b64 /Swift/QtUI/QtSwift.cpp
parentbc58d59636f28909d90464cea7ebf5eeb8f230be (diff)
downloadswift-c5aa27ee869cc4859e494bde8ddf7da60e177f40.zip
swift-c5aa27ee869cc4859e494bde8ddf7da60e177f40.tar.bz2
Enable log information export to a file
This patch introduces the “logfile” argument to the client, which can be used to specify a file path for a log file, where all logging information will be stored. Test-Information: Tested on windows 10 and Ubuntu 17.04 Change-Id: I6a2f14585a72f25e7e78d79cb633e1ddc4d43c3b
Diffstat (limited to 'Swift/QtUI/QtSwift.cpp')
-rw-r--r--Swift/QtUI/QtSwift.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 67fc659..7daa5ce 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -101,6 +101,7 @@ po::options_description QtSwift::getOptionsDescription() {
#if QT_VERSION >= 0x040800
("language", po::value<std::string>(), "Use a specific language, instead of the system-wide one")
#endif
+ ("logfile", po::value<std::string>()->implicit_value(""), "Save all logging information to a file")
;
return result;
}
@@ -189,6 +190,16 @@ QtSwift::QtSwift(const po::variables_map& options) : networkFactories_(&clientMa
Log::setLogLevel(Swift::Log::debug);
}
+ if (options.count("logfile")) {
+ try {
+ std::string fileName = options["logfile"].as<std::string>();
+ Log::setLogFile(fileName);
+ }
+ catch (...) {
+ SWIFT_LOG(error) << "Error while retrieving the specified log file name from the command line" << std::endl;
+ }
+ }
+
// Load fonts
std::vector<std::string> fontNames = {
"themes/Default/Lato2OFL/Lato-Black.ttf",