mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 13:03:55 -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
|
|
@ -42,7 +42,7 @@ CardZone::CardZone(Player *_p,
|
|||
|
||||
CardZone::~CardZone()
|
||||
{
|
||||
qDebug() << "CardZone destructor: " << name;
|
||||
qCDebug(CardZoneLog) << "CardZone destructor: " << name;
|
||||
for (auto *view : views) {
|
||||
if (view != nullptr) {
|
||||
view->deleteLater();
|
||||
|
|
@ -147,7 +147,7 @@ void CardZone::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
void CardZone::addCard(CardItem *card, const bool reorganize, const int x, const int y)
|
||||
{
|
||||
if (!card) {
|
||||
qDebug() << "CardZone::addCard() card is null, this shouldn't normally happen";
|
||||
qCDebug(CardZoneLog) << "CardZone::addCard() card is null, this shouldn't normally happen";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ CardItem *CardZone::getCard(int cardId, const QString &cardName)
|
|||
{
|
||||
CardItem *c = cards.findCard(cardId);
|
||||
if (!c) {
|
||||
qDebug() << "CardZone::getCard: card id=" << cardId << "not found";
|
||||
qCDebug(CardZoneLog) << "CardZone::getCard: card id=" << cardId << "not found";
|
||||
return nullptr;
|
||||
}
|
||||
// If the card's id is -1, this zone is invisible,
|
||||
|
|
@ -216,7 +216,7 @@ CardItem *CardZone::takeCard(int position, int cardId, bool /*canResize*/)
|
|||
void CardZone::removeCard(CardItem *card)
|
||||
{
|
||||
if (!card) {
|
||||
qDebug() << "CardZone::removeCard: card is null, this shouldn't normally happen";
|
||||
qCDebug(CardZoneLog) << "CardZone::removeCard: card is null, this shouldn't normally happen";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,11 @@
|
|||
#include "../board/abstract_graphics_item.h"
|
||||
#include "../cards/card_list.h"
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QString>
|
||||
|
||||
inline Q_LOGGING_CATEGORY(CardZoneLog, "card_zone");
|
||||
|
||||
class Player;
|
||||
class ZoneViewZone;
|
||||
class QMenu;
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ ZoneViewZone::GridSize ZoneViewZone::positionCardsForDisplay(CardList &cards, Ca
|
|||
if (cols < 2)
|
||||
cols = 2;
|
||||
|
||||
qDebug() << "reorganizeCards: rows=" << rows << "cols=" << cols;
|
||||
qCDebug(ViewZoneLog) << "reorganizeCards: rows=" << rows << "cols=" << cols;
|
||||
|
||||
for (int i = 0; i < cardCount; i++) {
|
||||
CardItem *c = cards.at(i);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,11 @@
|
|||
#include "select_zone.h"
|
||||
|
||||
#include <QGraphicsLayoutItem>
|
||||
#include <QLoggingCategory>
|
||||
#include <pb/commands.pb.h>
|
||||
|
||||
inline Q_LOGGING_CATEGORY(ViewZoneLog, "view_zone");
|
||||
|
||||
class ZoneViewWidget;
|
||||
class Response;
|
||||
class ServerInfo_Card;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue