summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2018-03-20 13:12:10 (GMT)
committerTobias Markmann <tm@ayena.de>2018-03-20 14:48:04 (GMT)
commitf2c2c7d035029fb9615b42c18ccea83e8e705b10 (patch)
tree2f56fb77de0f366528395f21732d418f016f63b5 /Swift/QtUI/QtSwift.cpp
parent44581c5285d13c0ec715b35ddc79177e5ebeef39 (diff)
parent5ba3f18ad8efa040d49f36d83ec2e7891a9add9f (diff)
downloadswift-f2c2c7d035029fb9615b42c18ccea83e8e705b10.zip
swift-f2c2c7d035029fb9615b42c18ccea83e8e705b10.tar.bz2
Merge branch 'swift-4.x'swift-5.0alpha2
* swift-4.x: (44 commits) Test-Information: Builds on macOS 10.13.3 with clang trunk. Change-Id: If50381f103b0ad18d038b920d3d43537642141cb
Diffstat (limited to 'Swift/QtUI/QtSwift.cpp')
-rw-r--r--Swift/QtUI/QtSwift.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 7b4e2c3..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",
@@ -214,7 +225,7 @@ QtSwift::QtSwift(const po::variables_map& options) : networkFactories_(&clientMa
for (auto&& fontName : fontNames) {
std::string fontPath = std::string(":/") + fontName;
int error = QFontDatabase::addApplicationFont(P2QSTRING(fontPath));
- assert((error != -1) && "Failed to load font.");
+ SWIFT_LOG_ASSERT(error != -1, error) << "Failed to load font " << fontPath << std::endl;
}
bool enableAdHocCommandOnJID = options.count("enable-jid-adhocs") > 0;