mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Move logging from QDebug to QCDebug and introduce LoggingCategories. (#5491)
* Move logging from QDebug to QCDebug and introduce LoggingCategories. * Lint. * Unlint like one change. * Remove .debug category since this is autofilled by Qt and used to differentiate between QCDebug and QCWarning and QCError. * Uncomment defaults, include main category. * Make PictureLoader logging a bit more useful. * Lint...? * Address comments. * Clean up some unnecessary classes in logging statements. * Add a new message format to the logging handler. * Lint. * Lint. * Support Windows in Regex --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
This commit is contained in:
parent
e752578d15
commit
aa24502129
63 changed files with 316 additions and 162 deletions
|
|
@ -102,7 +102,7 @@ public:
|
|||
inline bool operator()(const CardSetPtr &a, const CardSetPtr &b) const
|
||||
{
|
||||
if (a.isNull() || b.isNull()) {
|
||||
qDebug() << "SetList::KeyCompareFunctor a or b is null";
|
||||
qCDebug(CardDatabaseLog) << "SetList::KeyCompareFunctor a or b is null";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ void SetList::enableAll()
|
|||
CardSetPtr set = at(i);
|
||||
|
||||
if (set == nullptr) {
|
||||
qDebug() << "enabledAll has null";
|
||||
qCDebug(CardDatabaseLog) << "enabledAll has null";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ void SetList::guessSortKeys()
|
|||
for (int i = 0; i < size(); ++i) {
|
||||
CardSetPtr set = at(i);
|
||||
if (set.isNull()) {
|
||||
qDebug() << "guessSortKeys set is null";
|
||||
qCDebug(CardDatabaseLog) << "guessSortKeys set is null";
|
||||
continue;
|
||||
}
|
||||
set->setSortKey(i);
|
||||
|
|
@ -415,7 +415,7 @@ void CardDatabase::clear()
|
|||
void CardDatabase::addCard(CardInfoPtr card)
|
||||
{
|
||||
if (card == nullptr) {
|
||||
qDebug() << "addCard(nullptr)";
|
||||
qCDebug(CardDatabaseLog) << "CardDatabase::addCard(nullptr)";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -440,7 +440,7 @@ void CardDatabase::addCard(CardInfoPtr card)
|
|||
void CardDatabase::removeCard(CardInfoPtr card)
|
||||
{
|
||||
if (card.isNull()) {
|
||||
qDebug() << "removeCard(nullptr)";
|
||||
qCDebug(CardDatabaseLog) << "CardDatabase::removeCard(nullptr)";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -582,8 +582,8 @@ LoadStatus CardDatabase::loadCardDatabase(const QString &path)
|
|||
}
|
||||
|
||||
int msecs = startTime.msecsTo(QTime::currentTime());
|
||||
qDebug() << "[CardDatabase] loadCardDatabase(): Path =" << path << "Status =" << tempLoadStatus
|
||||
<< "Cards =" << cards.size() << "Sets =" << sets.size() << QString("%1ms").arg(msecs);
|
||||
qCDebug(CardDatabaseLoadingLog) << "Path =" << path << "Status =" << tempLoadStatus << "Cards =" << cards.size()
|
||||
<< "Sets =" << sets.size() << QString("%1ms").arg(msecs);
|
||||
|
||||
return tempLoadStatus;
|
||||
}
|
||||
|
|
@ -592,7 +592,7 @@ LoadStatus CardDatabase::loadCardDatabases()
|
|||
{
|
||||
reloadDatabaseMutex->lock();
|
||||
|
||||
qDebug() << "CardDatabase::loadCardDatabases start";
|
||||
qCDebug(CardDatabaseLoadingLog) << "Started";
|
||||
|
||||
clear(); // remove old db
|
||||
|
||||
|
|
@ -613,7 +613,7 @@ LoadStatus CardDatabase::loadCardDatabases()
|
|||
|
||||
for (auto i = 0; i < databasePaths.size(); ++i) {
|
||||
const auto &databasePath = databasePaths.at(i);
|
||||
qDebug() << "Loading Custom Set" << i << "(" << databasePath << ")";
|
||||
qCDebug(CardDatabaseLoadingLog) << "Loading Custom Set" << i << "(" << databasePath << ")";
|
||||
loadCardDatabase(databasePath);
|
||||
}
|
||||
|
||||
|
|
@ -626,10 +626,10 @@ LoadStatus CardDatabase::loadCardDatabases()
|
|||
|
||||
if (loadStatus == Ok) {
|
||||
checkUnknownSets(); // update deck editors, etc
|
||||
qDebug() << "CardDatabase::loadCardDatabases success";
|
||||
qCDebug(CardDatabaseLoadingSuccessOrFailureLog) << "Success";
|
||||
emit cardDatabaseLoadingFinished();
|
||||
} else {
|
||||
qDebug() << "CardDatabase::loadCardDatabases failed";
|
||||
qCDebug(CardDatabaseLoadingSuccessOrFailureLog) << "Failed";
|
||||
emit cardDatabaseLoadingFailed(); // bring up the settings dialog
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue