debug::Log can now be used instead of qDebug()

Usage:
```
QString string("world");
debug::Log("hello: {}", string);
```
This commit is contained in:
Rasmus Karlsson
2017-09-24 19:23:07 +02:00
parent af35c1f335
commit 81e06f3a53
3 changed files with 50 additions and 8 deletions
+6 -7
View File
@@ -1,5 +1,6 @@
#include "twitch/twitchmessagebuilder.hpp"
#include "colorscheme.hpp"
#include "debug/log.hpp"
#include "emotemanager.hpp"
#include "ircmanager.hpp"
#include "resources.hpp"
@@ -414,8 +415,8 @@ void TwitchMessageBuilder::parseHighlights()
if (!blackList.contains(this->ircMessage->nick(), Qt::CaseInsensitive)) {
for (const Highlight &highlight : activeHighlights) {
if (this->originalMessage.contains(highlight.target, Qt::CaseInsensitive)) {
qDebug() << "Highlight because " << this->originalMessage << " contains "
<< highlight.target;
debug::Log("Highlight because {} contains {}", this->originalMessage,
highlight.target);
doHighlight = true;
if (highlight.sound) {
@@ -569,13 +570,11 @@ void TwitchMessageBuilder::parseTwitchBadges()
Word(badgeVersion.badgeImage1x, Word::BadgeVanity, QString(),
QString("Twitch " + QString::fromStdString(badgeVersion.title))));
} catch (const std::exception &e) {
qDebug() << "Exception caught:" << e.what()
<< "when trying to fetch badge version " << versionKey.c_str();
debug::Log("Exception caught: {} when trying to fetch badge version {}",
e.what(), versionKey);
}
} catch (const std::exception &e) {
qDebug() << "No badge set with key"
<< "bits"
<< ". Exception: " << e.what();
debug::Log("No badge set with key bits. Exception: {}", e.what());
}
} else if (badge == "staff/1") {
appendWord(Word(this->resources.badgeStaff, Word::BadgeGlobalAuthority, QString(),