Added loggers to most classes

This commit is contained in:
Olivier Teulière 2012-02-18 22:26:52 +01:00
parent 684880acbe
commit bf42c49850
93 changed files with 272 additions and 9 deletions

View file

@ -39,6 +39,10 @@
using namespace std; using namespace std;
INIT_LOGGER(dic, Automaton);
#ifdef DEBUG_AUTOMATON #ifdef DEBUG_AUTOMATON
# define DMSG(a) (a) # define DMSG(a) (a)
#else #else

View file

@ -21,11 +21,14 @@
#ifndef DIC_AUTOMATON_H_ #ifndef DIC_AUTOMATON_H_
#define DIC_AUTOMATON_H_ #define DIC_AUTOMATON_H_
#include "logging.h"
class AutomatonHelper; class AutomatonHelper;
struct searchRegExpLists; struct searchRegExpLists;
class Automaton class Automaton
{ {
DEFINE_LOGGER();
public: public:
/// Constructor /// Constructor
/** /**

View file

@ -66,6 +66,7 @@
INIT_LOGGER(dic, CompDic); INIT_LOGGER(dic, CompDic);
CompDic::CompDic() CompDic::CompDic()
: m_currentRec(0), m_maxRec(0), m_loadTime(0), m_buildTime(0) : m_currentRec(0), m_maxRec(0), m_loadTime(0), m_buildTime(0)
{ {

View file

@ -26,9 +26,9 @@
#include <iosfwd> #include <iosfwd>
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#include "logging.h"
#include "header.h" #include "header.h"
#include "dic_internals.h" #include "dic_internals.h"
#include "logging.h"
class DicEdge; class DicEdge;
class DictHeaderInfo; class DictHeaderInfo;

View file

@ -48,6 +48,9 @@
#include "tile.h" #include "tile.h"
INIT_LOGGER(dic, Dictionary);
const Dictionary *Dictionary::m_dic = NULL; const Dictionary *Dictionary::m_dic = NULL;

View file

@ -28,6 +28,7 @@
#include <map> #include <map>
#include "tile.h" #include "tile.h"
#include "logging.h"
using namespace std; using namespace std;
@ -59,6 +60,7 @@ typedef wstring wistring;
class Dictionary class Dictionary
{ {
DEFINE_LOGGER();
public: public:
/** /**
* Dictionary creation and loading from a file * Dictionary creation and loading from a file

View file

@ -56,6 +56,9 @@ using boost::format;
using boost::wformat; using boost::wformat;
INIT_LOGGER(dic, Header);
#if defined(WORDS_BIGENDIAN) #if defined(WORDS_BIGENDIAN)
// Nothing to do on big-endian machines // Nothing to do on big-endian machines
# define ntohll(x) (x) # define ntohll(x) (x)

View file

@ -27,6 +27,8 @@
#include <time.h> #include <time.h>
#include <stdint.h> #include <stdint.h>
#include "logging.h"
using namespace std; using namespace std;
// XXX: duplicated typedef (also present in dic.h) // XXX: duplicated typedef (also present in dic.h)
@ -76,6 +78,7 @@ struct DictHeaderInfo
*/ */
class Header class Header
{ {
DEFINE_LOGGER();
public: public:
/// Dictionary type /// Dictionary type

View file

@ -35,6 +35,10 @@
using namespace std; using namespace std;
INIT_LOGGER(dic, ListDic);
static void printDicRec(ostream &out, const Dictionary &iDic, const wchar_t * const buf, wchar_t *s, DicEdge edge) static void printDicRec(ostream &out, const Dictionary &iDic, const wchar_t * const buf, wchar_t *s, DicEdge edge)
{ {
if (edge.term) /* edge points at a complete word */ if (edge.term) /* edge points at a complete word */

View file

@ -23,6 +23,8 @@
#include <iosfwd> #include <iosfwd>
#include "logging.h"
class Dictionary; class Dictionary;
@ -31,7 +33,7 @@ using namespace std;
class ListDic class ListDic
{ {
DEFINE_LOGGER();
public: public:
ListDic(); ListDic();

View file

@ -36,6 +36,9 @@
using namespace std; using namespace std;
INIT_LOGGER(dic, StackTrace);
string StackTrace::GetStack() string StackTrace::GetStack()
{ {
#if defined HAVE_EXECINFO_H && defined(DEBUG) #if defined HAVE_EXECINFO_H && defined(DEBUG)

View file

@ -23,11 +23,14 @@
#include <string> #include <string>
#include "logging.h"
using std::string; using std::string;
class StackTrace class StackTrace
{ {
DEFINE_LOGGER();
public: public:
static string GetStack(); static string GetStack();

View file

@ -29,6 +29,9 @@
#include "dic_exception.h" #include "dic_exception.h"
INIT_LOGGER(dic, Tile);
const Header * Tile::m_header = NULL; const Header * Tile::m_header = NULL;
Tile Tile::m_TheJoker; Tile Tile::m_TheJoker;

View file

@ -26,6 +26,8 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "logging.h"
using namespace std; using namespace std;
class Header; class Header;
@ -37,6 +39,7 @@ class Header;
*/ */
class Tile class Tile
{ {
DEFINE_LOGGER();
friend class Dictionary; friend class Dictionary;
public: public:

View file

@ -28,6 +28,9 @@
#include "ai_percent.h" #include "ai_percent.h"
INIT_LOGGER(game, AIPercent);
AIPercent::AIPercent(float iPercent) AIPercent::AIPercent(float iPercent)
{ {
if (iPercent < 0) if (iPercent < 0)

View file

@ -23,6 +23,7 @@
#include "ai_player.h" #include "ai_player.h"
#include "results.h" #include "results.h"
#include "logging.h"
/** /**
* This kind of AI is parameterized by a percentage p. * This kind of AI is parameterized by a percentage p.
@ -37,6 +38,7 @@
*/ */
class AIPercent: public AIPlayer class AIPercent: public AIPlayer
{ {
DEFINE_LOGGER();
public: public:
/// Constructor, taking the percentage (0.0 <= iPercent <= 1.0) /// Constructor, taking the percentage (0.0 <= iPercent <= 1.0)
AIPercent(float iPercent); AIPercent(float iPercent);

View file

@ -31,6 +31,9 @@
#include "encoding.h" #include "encoding.h"
INIT_LOGGER(game, Bag);
Bag::Bag(const Dictionary &iDic) Bag::Bag(const Dictionary &iDic)
: m_dic(iDic), m_ntiles(0) : m_dic(iDic), m_ntiles(0)
{ {

View file

@ -24,6 +24,7 @@
#include <map> #include <map>
#include "tile.h" #include "tile.h"
#include "logging.h"
using std::map; using std::map;
@ -35,6 +36,7 @@ class Dictionary;
*/ */
class Bag class Bag
{ {
DEFINE_LOGGER();
public: public:
explicit Bag(const Dictionary &iDic); explicit Bag(const Dictionary &iDic);

View file

@ -42,6 +42,9 @@
#define W3 3 #define W3 3
INIT_LOGGER(game, Board);
const int Board::m_tileMultipliers[BOARD_REALDIM][BOARD_REALDIM] = const int Board::m_tileMultipliers[BOARD_REALDIM][BOARD_REALDIM] =
{ {
{ oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo }, { oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo },

View file

@ -27,6 +27,7 @@
#include "matrix.h" #include "matrix.h"
#include "tile.h" #include "tile.h"
#include "cross.h" #include "cross.h"
#include "logging.h"
class GameParams; class GameParams;
class Dictionary; class Dictionary;
@ -50,6 +51,7 @@ using namespace std;
*/ */
class Board class Board
{ {
DEFINE_LOGGER();
public: public:
Board(const GameParams &iParams); Board(const GameParams &iParams);

View file

@ -22,6 +22,9 @@
#include "debug.h" #include "debug.h"
INIT_LOGGER(game, Command);
Command::Command() Command::Command()
: m_executed(false), m_autoExecution(true) : m_executed(false), m_autoExecution(true)
{ {

View file

@ -23,6 +23,8 @@
#include <string> #include <string>
#include "logging.h"
using std::wstring; using std::wstring;
@ -32,6 +34,8 @@ using std::wstring;
*/ */
class Command class Command
{ {
DEFINE_LOGGER();
public: public:
Command(); Command();
virtual ~Command() {} virtual ~Command() {}

View file

@ -28,6 +28,9 @@
#include "encoding.h" #include "encoding.h"
INIT_LOGGER(game, Coord);
Coord::Coord(int iRow, int iCol, Direction iDir) Coord::Coord(int iRow, int iCol, Direction iDir)
{ {
m_row = iRow; m_row = iRow;

View file

@ -24,6 +24,8 @@
#include <string> #include <string>
#include "logging.h"
using std::wstring; using std::wstring;
@ -33,6 +35,7 @@ using std::wstring;
*/ */
class Coord class Coord
{ {
DEFINE_LOGGER();
public: public:
enum Direction {VERTICAL, HORIZONTAL}; enum Direction {VERTICAL, HORIZONTAL};

View file

@ -26,6 +26,9 @@
#define CROSS_MASK 0xFFFFFFFF #define CROSS_MASK 0xFFFFFFFF
INIT_LOGGER(game, Cross);
Cross::Cross() Cross::Cross()
{ {
// The default behaviour is to match everything // The default behaviour is to match everything

View file

@ -24,6 +24,7 @@
#include <set> #include <set>
#include "tile.h" #include "tile.h"
#include "logging.h"
using namespace std; using namespace std;
@ -35,6 +36,7 @@ using namespace std;
// TODO: implement using the bitset class // TODO: implement using the bitset class
class Cross class Cross
{ {
DEFINE_LOGGER();
public: public:
Cross(); Cross();

View file

@ -28,6 +28,9 @@
#include "turn.h" #include "turn.h"
INIT_LOGGER(game, GameMoveCmd);
GameMoveCmd::GameMoveCmd(Game &ioGame, const Move &iMove, GameMoveCmd::GameMoveCmd(Game &ioGame, const Move &iMove,
unsigned int iPlayerId) unsigned int iPlayerId)
: m_game(ioGame), m_move(iMove), : m_game(ioGame), m_move(iMove),

View file

@ -25,6 +25,7 @@
#include "move.h" #include "move.h"
#include "pldrack.h" #include "pldrack.h"
#include "round.h" #include "round.h"
#include "logging.h"
class Game; class Game;
@ -42,6 +43,8 @@ class Game;
*/ */
class GameMoveCmd: public Command class GameMoveCmd: public Command
{ {
DEFINE_LOGGER();
public: public:
GameMoveCmd(Game &ioGame, const Move &iMove, GameMoveCmd(Game &ioGame, const Move &iMove,
unsigned int iPlayerId); unsigned int iPlayerId);

View file

@ -31,6 +31,9 @@
#include "debug.h" #include "debug.h"
INIT_LOGGER(game, History);
History::History() History::History()
{ {
Turn* t = new Turn(); Turn* t = new Turn();

View file

@ -25,6 +25,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "logging.h"
using std::wstring; using std::wstring;
using std::vector; using std::vector;
@ -52,7 +54,8 @@ class PlayedRack;
*/ */
class History class History
{ {
public: DEFINE_LOGGER();
public:
History(); History();
~History(); ~History();

View file

@ -25,6 +25,9 @@
using namespace std; using namespace std;
INIT_LOGGER(game, MarkPlayedCmd);
MarkPlayedCmd::MarkPlayedCmd(Duplicate &ioDuplicate, MarkPlayedCmd::MarkPlayedCmd(Duplicate &ioDuplicate,
unsigned int iPlayerId, unsigned int iPlayerId,
bool iPlayedFlag) bool iPlayedFlag)

View file

@ -22,6 +22,7 @@
#define MARK_PLAYED_CMD_H_ #define MARK_PLAYED_CMD_H_
#include "command.h" #include "command.h"
#include "logging.h"
class Duplicate; class Duplicate;
@ -32,6 +33,8 @@ class Duplicate;
*/ */
class MarkPlayedCmd: public Command class MarkPlayedCmd: public Command
{ {
DEFINE_LOGGER();
public: public:
MarkPlayedCmd(Duplicate &ioDuplicate, MarkPlayedCmd(Duplicate &ioDuplicate,
unsigned int iPlayerId, unsigned int iPlayerId,

View file

@ -25,6 +25,9 @@
using namespace std; using namespace std;
INIT_LOGGER(game, MasterMoveCmd);
MasterMoveCmd::MasterMoveCmd(Duplicate &ioDuplicate, MasterMoveCmd::MasterMoveCmd(Duplicate &ioDuplicate,
const Move &iMove) const Move &iMove)
: m_duplicateGame(ioDuplicate), m_newMove(iMove) : m_duplicateGame(ioDuplicate), m_newMove(iMove)

View file

@ -23,6 +23,7 @@
#include "command.h" #include "command.h"
#include "move.h" #include "move.h"
#include "logging.h"
class Duplicate; class Duplicate;
@ -32,6 +33,8 @@ class Duplicate;
*/ */
class MasterMoveCmd: public Command class MasterMoveCmd: public Command
{ {
DEFINE_LOGGER();
public: public:
MasterMoveCmd(Duplicate &ioDuplicate, MasterMoveCmd(Duplicate &ioDuplicate,
const Move &iMove); const Move &iMove);

View file

@ -30,6 +30,9 @@
#include "debug.h" #include "debug.h"
INIT_LOGGER(game, Move);
Move::Move() Move::Move()
:m_score(0) :m_score(0)
{ {

View file

@ -24,6 +24,7 @@
#include <string> #include <string>
#include "round.h" #include "round.h"
#include "logging.h"
class Rack; class Rack;
class PlayedRack; class PlayedRack;
@ -44,6 +45,8 @@ using std::wstring;
*/ */
class Move class Move
{ {
DEFINE_LOGGER();
public: public:
/** /**
* Default constructor, corresponding to no move * Default constructor, corresponding to no move

View file

@ -33,6 +33,9 @@
#include "debug.h" #include "debug.h"
INIT_LOGGER(game, Player);
Player::Player() Player::Player()
: m_id(0), m_score(0) : m_id(0), m_score(0)
{ {

View file

@ -26,6 +26,7 @@
#include <string> #include <string>
#include "pldrack.h" #include "pldrack.h"
#include "history.h" #include "history.h"
#include "logging.h"
using std::wstring; using std::wstring;
@ -39,6 +40,7 @@ class Rack;
*/ */
class Player class Player
{ {
DEFINE_LOGGER();
public: public:
explicit Player(); explicit Player();
virtual ~Player() {} virtual ~Player() {}

View file

@ -24,6 +24,9 @@
#include <sstream> #include <sstream>
INIT_LOGGER(game, PlayerMoveCmd);
PlayerMoveCmd::PlayerMoveCmd(Player &ioPlayer, const Move &iMove) PlayerMoveCmd::PlayerMoveCmd(Player &ioPlayer, const Move &iMove)
: m_player(ioPlayer), m_move(iMove) : m_player(ioPlayer), m_move(iMove)
{ {

View file

@ -24,6 +24,7 @@
#include "command.h" #include "command.h"
#include "move.h" #include "move.h"
#include "pldrack.h" #include "pldrack.h"
#include "logging.h"
class Player; class Player;
class Rack; class Rack;
@ -41,6 +42,8 @@ class Rack;
*/ */
class PlayerMoveCmd: public Command class PlayerMoveCmd: public Command
{ {
DEFINE_LOGGER();
public: public:
PlayerMoveCmd(Player &ioPlayer, const Move &iMove); PlayerMoveCmd(Player &ioPlayer, const Move &iMove);

View file

@ -24,6 +24,9 @@
#include "player.h" #include "player.h"
INIT_LOGGER(game, PlayerPointsCmd);
PlayerPointsCmd::PlayerPointsCmd(Player &ioPlayer, int iPoints) PlayerPointsCmd::PlayerPointsCmd(Player &ioPlayer, int iPoints)
: m_player(ioPlayer), m_points(iPoints) : m_player(ioPlayer), m_points(iPoints)
{ {

View file

@ -22,6 +22,7 @@
#define PLAYER_POINTS_CMD_H_ #define PLAYER_POINTS_CMD_H_
#include "command.h" #include "command.h"
#include "logging.h"
class Player; class Player;
@ -32,6 +33,8 @@ class Player;
*/ */
class PlayerPointsCmd: public Command class PlayerPointsCmd: public Command
{ {
DEFINE_LOGGER();
public: public:
PlayerPointsCmd(Player &ioPlayer, int iPoints); PlayerPointsCmd(Player &ioPlayer, int iPoints);

View file

@ -24,6 +24,9 @@
#include "player.h" #include "player.h"
INIT_LOGGER(game, PlayerRackCmd);
PlayerRackCmd::PlayerRackCmd(Player &ioPlayer, const PlayedRack &iNewRack) PlayerRackCmd::PlayerRackCmd(Player &ioPlayer, const PlayedRack &iNewRack)
: m_player(ioPlayer), m_newRack(iNewRack) : m_player(ioPlayer), m_newRack(iNewRack)
{ {

View file

@ -23,6 +23,7 @@
#include "command.h" #include "command.h"
#include "pldrack.h" #include "pldrack.h"
#include "logging.h"
class Player; class Player;
@ -33,6 +34,8 @@ class Player;
*/ */
class PlayerRackCmd: public Command class PlayerRackCmd: public Command
{ {
DEFINE_LOGGER();
public: public:
PlayerRackCmd(Player &ioPlayer, const PlayedRack &iNewRack); PlayerRackCmd(Player &ioPlayer, const PlayedRack &iNewRack);

View file

@ -26,6 +26,9 @@
#include "rack.h" #include "rack.h"
INIT_LOGGER(game, PlayedRack);
PlayedRack::PlayedRack() PlayedRack::PlayedRack()
: m_reject(false) : m_reject(false)
{ {

View file

@ -25,6 +25,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include "tile.h" #include "tile.h"
#include "logging.h"
class Rack; class Rack;
@ -39,6 +40,7 @@ using namespace std;
*/ */
class PlayedRack class PlayedRack
{ {
DEFINE_LOGGER();
public: public:
PlayedRack(); PlayedRack();

View file

@ -25,6 +25,9 @@
#include "debug.h" #include "debug.h"
INIT_LOGGER(game, Rack);
Rack::Rack() Rack::Rack()
: m_tiles(Dictionary::GetDic().getTileNumber() + 1, 0), m_ntiles(0) : m_tiles(Dictionary::GetDic().getTileNumber() + 1, 0), m_ntiles(0)
{ {

View file

@ -26,6 +26,7 @@
#include <string> #include <string>
#include "tile.h" #include "tile.h"
#include "logging.h"
using namespace std; using namespace std;
@ -36,6 +37,7 @@ using namespace std;
*/ */
class Rack class Rack
{ {
DEFINE_LOGGER();
public: public:
Rack(); Rack();

View file

@ -32,6 +32,9 @@
#include "debug.h" #include "debug.h"
INIT_LOGGER(game, Results);
bool tileCompare(const Tile &t1, const Tile &t2) bool tileCompare(const Tile &t1, const Tile &t2)
{ {
return t1.toCode() < t2.toCode(); return t1.toCode() < t2.toCode();

View file

@ -25,6 +25,7 @@
#include <vector> #include <vector>
#include <map> #include <map>
#include "round.h" #include "round.h"
#include "logging.h"
using namespace std; using namespace std;
@ -46,6 +47,7 @@ class Rack;
*/ */
class Results class Results
{ {
DEFINE_LOGGER();
public: public:
virtual ~Results() {} virtual ~Results() {}
unsigned int size() const { return m_rounds.size(); } unsigned int size() const { return m_rounds.size(); }

View file

@ -28,6 +28,9 @@
#include "encoding.h" #include "encoding.h"
INIT_LOGGER(game, Round);
#define FROMBOARD 0x1 #define FROMBOARD 0x1
#define FROMRACK 0x2 #define FROMRACK 0x2
#define JOKER 0x4 #define JOKER 0x4

View file

@ -25,6 +25,7 @@
#include <vector> #include <vector>
#include "tile.h" #include "tile.h"
#include "coord.h" #include "coord.h"
#include "logging.h"
using namespace std; using namespace std;
@ -37,6 +38,7 @@ using namespace std;
*/ */
class Round class Round
{ {
DEFINE_LOGGER();
public: public:
/************************* /*************************

View file

@ -41,6 +41,9 @@
using namespace libconfig; using namespace libconfig;
INIT_LOGGER(game, Settings);
Settings *Settings::m_instance = NULL; Settings *Settings::m_instance = NULL;

View file

@ -24,6 +24,8 @@
#include <string> #include <string>
#include <map> #include <map>
#include "logging.h"
using std::string; using std::string;
using std::map; using std::map;
@ -44,6 +46,7 @@ namespace libconfig
*/ */
class Settings class Settings
{ {
DEFINE_LOGGER();
public: public:
/// Access to the singleton /// Access to the singleton
static Settings& Instance(); static Settings& Instance();

View file

@ -22,6 +22,9 @@
#include "turn.h" #include "turn.h"
INIT_LOGGER(game, Turn);
// FIXME: move set to an arbitrary one (no move). It would be better to get rid of this // FIXME: move set to an arbitrary one (no move). It would be better to get rid of this
// constructor completely // constructor completely
Turn::Turn() Turn::Turn()

View file

@ -25,6 +25,7 @@
#include <string> #include <string>
#include "pldrack.h" #include "pldrack.h"
#include "move.h" #include "move.h"
#include "logging.h"
using std::wstring; using std::wstring;
@ -38,6 +39,7 @@ using std::wstring;
*/ */
class Turn class Turn
{ {
DEFINE_LOGGER();
public: public:
Turn(); Turn();
Turn(unsigned int iPlayerId, Turn(unsigned int iPlayerId,

View file

@ -25,6 +25,9 @@
#include "player.h" #include "player.h"
INIT_LOGGER(game, TurnCmd);
TurnCmd::TurnCmd() TurnCmd::TurnCmd()
{ {
// Fake execution // Fake execution

View file

@ -24,6 +24,7 @@
#include <vector> #include <vector>
#include "command.h" #include "command.h"
#include "logging.h"
using namespace std; using namespace std;
@ -34,6 +35,8 @@ using namespace std;
*/ */
class TurnCmd: public Command class TurnCmd: public Command
{ {
DEFINE_LOGGER();
public: public:
TurnCmd(); TurnCmd();
virtual ~TurnCmd(); virtual ~TurnCmd();

View file

@ -31,6 +31,9 @@
#include "qtcommon.h" #include "qtcommon.h"
INIT_LOGGER(qt, AuxWindow);
AuxWindow::AuxWindow(QWidget &iWidget, QString iWindowTitle, AuxWindow::AuxWindow(QWidget &iWidget, QString iWindowTitle,
QString iWindowName, QAction *iAction) QString iWindowName, QAction *iAction)
: m_widget(iWidget), m_windowName(iWindowName), m_action(iAction) : m_widget(iWidget), m_windowName(iWindowName), m_action(iAction)

View file

@ -23,6 +23,8 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include "logging.h"
class QAction; class QAction;
@ -34,6 +36,7 @@ class QAction;
class AuxWindow: public QWidget class AuxWindow: public QWidget
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
/** /**

View file

@ -34,6 +34,9 @@
using namespace std; using namespace std;
INIT_LOGGER(qt, BagWidget);
BagWidget::BagWidget(QWidget *parent) BagWidget::BagWidget(QWidget *parent)
: QWidget(parent), m_game(NULL) : QWidget(parent), m_game(NULL)
{ {

View file

@ -24,6 +24,7 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <ui/bag_widget.ui.h> #include <ui/bag_widget.ui.h>
#include "logging.h"
class PublicGame; class PublicGame;
//class QTreeView; //class QTreeView;
@ -32,6 +33,7 @@ class QStandardItemModel;
class BagWidget: public QWidget, private Ui::BagWidget class BagWidget: public QWidget, private Ui::BagWidget
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit BagWidget(QWidget *parent = 0); explicit BagWidget(QWidget *parent = 0);

View file

@ -38,6 +38,9 @@
using namespace std; using namespace std;
INIT_LOGGER(qt, BagWidget2);
BagWidget2::BagWidget2(QWidget *parent) BagWidget2::BagWidget2(QWidget *parent)
: QWidget(parent), m_game(NULL), m_totalNbTiles(0), : QWidget(parent), m_game(NULL), m_totalNbTiles(0),
m_showPlayedTiles(true), m_showTilesInRack(true) m_showPlayedTiles(true), m_showTilesInRack(true)

View file

@ -24,6 +24,8 @@
#include <vector> #include <vector>
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include "logging.h"
using std::vector; using std::vector;
class PublicGame; class PublicGame;
@ -33,6 +35,7 @@ class TileWidget;
class BagWidget2: public QWidget class BagWidget2: public QWidget
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit BagWidget2(QWidget *parent = 0); explicit BagWidget2(QWidget *parent = 0);

View file

@ -34,6 +34,9 @@
using namespace std; using namespace std;
INIT_LOGGER(qt, BoardWidget);
BoardWidget::BoardWidget(CoordModel &iCoordModel, QWidget *parent) BoardWidget::BoardWidget(CoordModel &iCoordModel, QWidget *parent)
: QFrame(parent), m_game(NULL), : QFrame(parent), m_game(NULL),
m_coordModel(iCoordModel), m_showTemporarySigns(true), m_coordModel(iCoordModel), m_showTemporarySigns(true),

View file

@ -22,7 +22,9 @@
#define BOARD_WIDGET_H_ #define BOARD_WIDGET_H_
#include <QtGui/QFrame> #include <QtGui/QFrame>
#include "matrix.h" #include "matrix.h"
#include "logging.h"
class PublicGame; class PublicGame;
@ -33,6 +35,7 @@ class Coord;
class BoardWidget: public QFrame class BoardWidget: public QFrame
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit BoardWidget(CoordModel &iCoordModel, QWidget *parent = 0); explicit BoardWidget(CoordModel &iCoordModel, QWidget *parent = 0);

View file

@ -21,6 +21,9 @@
#include "coord_model.h" #include "coord_model.h"
INIT_LOGGER(qt, CoordModel);
void CoordModel::setCoord(const Coord &iCoord) void CoordModel::setCoord(const Coord &iCoord)
{ {
m_prevCoord = m_currCoord; m_prevCoord = m_currCoord;

View file

@ -22,12 +22,15 @@
#define COORD_MODEL_H_ #define COORD_MODEL_H_
#include <QObject> #include <QObject>
#include "coord.h" #include "coord.h"
#include "logging.h"
class CoordModel: public QObject class CoordModel: public QObject
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
void setCoord(const Coord &iCoord); void setCoord(const Coord &iCoord);

View file

@ -24,6 +24,9 @@
#include "qtcommon.h" #include "qtcommon.h"
INIT_LOGGER(qt, CustomPopup);
CustomPopup::CustomPopup(QWidget *iWidget) CustomPopup::CustomPopup(QWidget *iWidget)
: QObject(iWidget), m_widget(iWidget) : QObject(iWidget), m_widget(iWidget)
{ {

View file

@ -24,6 +24,8 @@
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QString> #include <QtCore/QString>
#include "logging.h"
class QWidget; class QWidget;
class QPoint; class QPoint;
class QMenu; class QMenu;
@ -32,6 +34,7 @@ class QMenu;
class CustomPopup: public QObject class CustomPopup: public QObject
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
CustomPopup(QWidget *iWidget); CustomPopup(QWidget *iWidget);

View file

@ -43,6 +43,9 @@
using namespace std; using namespace std;
INIT_LOGGER(qt, DicToolsWidget);
DicToolsWidget::DicToolsWidget(QWidget *parent) DicToolsWidget::DicToolsWidget(QWidget *parent)
: QWidget(parent), m_dic(NULL) : QWidget(parent), m_dic(NULL)
{ {

View file

@ -24,7 +24,9 @@
#include <string> #include <string>
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QPalette> #include <QtGui/QPalette>
#include "ui/dic_tools_widget.ui.h" #include "ui/dic_tools_widget.ui.h"
#include "logging.h"
class QStandardItemModel; class QStandardItemModel;
class QString; class QString;
@ -34,6 +36,7 @@ class CustomPopup;
class DicToolsWidget: public QWidget, private Ui::DicToolsWidget class DicToolsWidget: public QWidget, private Ui::DicToolsWidget
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit DicToolsWidget(QWidget *parent = 0); explicit DicToolsWidget(QWidget *parent = 0);

View file

@ -39,6 +39,12 @@
using namespace std; using namespace std;
INIT_LOGGER(qt, DicWizard);
INIT_LOGGER(qt, WizardInfoPage);
INIT_LOGGER(qt, WizardLettersDefPage);
INIT_LOGGER(qt, WizardConclusionPage);
// ---------- WizardInfoPage ---------- // ---------- WizardInfoPage ----------
WizardInfoPage::WizardInfoPage(QWidget *parent) : QWizardPage(parent) WizardInfoPage::WizardInfoPage(QWidget *parent) : QWizardPage(parent)

View file

@ -28,6 +28,7 @@
#include "ui/dic_wizard_info_page.ui.h" #include "ui/dic_wizard_info_page.ui.h"
#include "ui/dic_wizard_letters_def_page.ui.h" #include "ui/dic_wizard_letters_def_page.ui.h"
#include "ui/dic_wizard_conclusion_page.ui.h" #include "ui/dic_wizard_conclusion_page.ui.h"
#include "logging.h"
class QStandardItemModel; class QStandardItemModel;
class QItemSelection; class QItemSelection;
@ -37,6 +38,7 @@ class QModelIndex;
class DicWizard: public QWizard class DicWizard: public QWizard
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
DicWizard(QWidget *parent); DicWizard(QWidget *parent);
@ -53,7 +55,8 @@ signals:
class WizardInfoPage: public QWizardPage, private Ui::WizardInfoPage class WizardInfoPage: public QWizardPage, private Ui::WizardInfoPage
{ {
Q_OBJECT Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit WizardInfoPage(QWidget *parent = 0); explicit WizardInfoPage(QWidget *parent = 0);
virtual bool isComplete() const; virtual bool isComplete() const;
@ -67,7 +70,8 @@ private slots:
class WizardLettersDefPage: public QWizardPage, private Ui::WizardLettersDefPage class WizardLettersDefPage: public QWizardPage, private Ui::WizardLettersDefPage
{ {
Q_OBJECT Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit WizardLettersDefPage(QWidget *parent = 0); explicit WizardLettersDefPage(QWidget *parent = 0);
const QStandardItemModel * getModel() const { return m_model; } const QStandardItemModel * getModel() const { return m_model; }
@ -82,7 +86,8 @@ private slots:
class WizardConclusionPage: public QWizardPage, private Ui::WizardConclusionPage class WizardConclusionPage: public QWizardPage, private Ui::WizardConclusionPage
{ {
Q_OBJECT Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit WizardConclusionPage(QWidget *parent = 0); explicit WizardConclusionPage(QWidget *parent = 0);
virtual void initializePage(); virtual void initializePage();

View file

@ -40,6 +40,9 @@
using namespace std; using namespace std;
INIT_LOGGER(qt, HistoryWidget);
HistoryWidget::HistoryWidget(QWidget *parent) HistoryWidget::HistoryWidget(QWidget *parent)
: QTreeView(parent), m_history(NULL), m_forPlayer(false), m_isFreeGame(false) : QTreeView(parent), m_history(NULL), m_forPlayer(false), m_isFreeGame(false)
{ {

View file

@ -24,6 +24,8 @@
#include <QtGui/QTreeView> #include <QtGui/QTreeView>
#include <QtGui/QTabWidget> #include <QtGui/QTabWidget>
#include "logging.h"
class History; class History;
class PublicGame; class PublicGame;
@ -34,6 +36,7 @@ class CustomPopup;
class HistoryWidget: public QTreeView class HistoryWidget: public QTreeView
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit HistoryWidget(QWidget *parent = 0); explicit HistoryWidget(QWidget *parent = 0);

View file

@ -23,8 +23,7 @@
#include <QDialog> #include <QDialog>
#include <ui/new_game.ui.h> #include "ui/new_game.ui.h"
#include "logging.h" #include "logging.h"

View file

@ -32,6 +32,9 @@
#include "debug.h" #include "debug.h"
INIT_LOGGER(qt, PlayWordMediator);
PlayWordMediator::PlayWordMediator(QObject *parent, QLineEdit &iEditPlay, PlayWordMediator::PlayWordMediator(QObject *parent, QLineEdit &iEditPlay,
QLineEdit &iEditCoord, QLineEdit &iEditPoints, QLineEdit &iEditCoord, QLineEdit &iEditPoints,
QPushButton &iButtonPlay, QPushButton &iButtonPlay,

View file

@ -24,6 +24,8 @@
#include <string> #include <string>
#include <QtGui/QValidator> #include <QtGui/QValidator>
#include "logging.h"
using std::wstring; using std::wstring;
@ -50,6 +52,7 @@ class Dictionary;
class PlayWordMediator: public QObject class PlayWordMediator: public QObject
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
PlayWordMediator(QObject *parent, QLineEdit &iEditWord, PlayWordMediator(QObject *parent, QLineEdit &iEditWord,

View file

@ -36,6 +36,9 @@
#include "encoding.h" #include "encoding.h"
INIT_LOGGER(qt, PlayerWidget);
PlayerWidget::PlayerWidget(QWidget *parent, CoordModel &iCoordModel, PlayerWidget::PlayerWidget(QWidget *parent, CoordModel &iCoordModel,
unsigned int iPlayerNb, PublicGame *iGame) unsigned int iPlayerNb, PublicGame *iGame)
: QWidget(parent), m_game(iGame), m_player(iPlayerNb) : QWidget(parent), m_game(iGame), m_player(iPlayerNb)

View file

@ -23,7 +23,9 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QTabWidget> #include <QtGui/QTabWidget>
#include "ui/player_widget.ui.h" #include "ui/player_widget.ui.h"
#include "logging.h"
class QLineEdit; class QLineEdit;
@ -35,6 +37,7 @@ class Coord;
class PlayerWidget: public QWidget, private Ui::PlayerWidget class PlayerWidget: public QWidget, private Ui::PlayerWidget
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit PlayerWidget(QWidget *parent, explicit PlayerWidget(QWidget *parent,

View file

@ -32,6 +32,9 @@
#include "settings.h" #include "settings.h"
INIT_LOGGER(qt, PrefsDialog);
const QString PrefsDialog::kINTF_ALIGN_HISTORY = "Interface/AlignHistory"; const QString PrefsDialog::kINTF_ALIGN_HISTORY = "Interface/AlignHistory";
const QString PrefsDialog::kINTF_DIC_PATH = "Interface/DicPath"; const QString PrefsDialog::kINTF_DIC_PATH = "Interface/DicPath";
const QString PrefsDialog::kINTF_DEFINITIONS_SITE_URL = "Interface/DefinitionsSiteUrl"; const QString PrefsDialog::kINTF_DEFINITIONS_SITE_URL = "Interface/DefinitionsSiteUrl";

View file

@ -24,7 +24,8 @@
#include <QtGui/QDialog> #include <QtGui/QDialog>
#include <QtCore/QString> #include <QtCore/QString>
#include <ui/prefs_dialog.ui.h> #include "ui/prefs_dialog.ui.h"
#include "logging.h"
class QStringList; class QStringList;
@ -32,6 +33,7 @@ class QStringList;
class PrefsDialog: public QDialog, private Ui::PrefsDialog class PrefsDialog: public QDialog, private Ui::PrefsDialog
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit PrefsDialog(QWidget *iParent = 0); explicit PrefsDialog(QWidget *iParent = 0);

View file

@ -29,6 +29,9 @@
using namespace std; using namespace std;
INIT_LOGGER(qt, ScoreWidget);
ScoreWidget::ScoreWidget(QWidget *parent, const PublicGame *iGame) ScoreWidget::ScoreWidget(QWidget *parent, const PublicGame *iGame)
: QTreeView(parent), m_game(iGame) : QTreeView(parent), m_game(iGame)
{ {

View file

@ -23,6 +23,8 @@
#include <QtGui/QTreeView> #include <QtGui/QTreeView>
#include "logging.h"
class PublicGame; class PublicGame;
class QStandardItemModel; class QStandardItemModel;
@ -30,6 +32,7 @@ class QStandardItemModel;
class ScoreWidget: public QTreeView class ScoreWidget: public QTreeView
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit ScoreWidget(QWidget *parent = 0, const PublicGame *iGame = NULL); explicit ScoreWidget(QWidget *parent = 0, const PublicGame *iGame = NULL);

View file

@ -23,6 +23,8 @@
#include "timer_widget.h" #include "timer_widget.h"
INIT_LOGGER(qt, TimerModel);
INIT_LOGGER(qt, TimerWidget); INIT_LOGGER(qt, TimerWidget);

View file

@ -33,6 +33,7 @@ class QTimer;
class TimerModel : public QObject class TimerModel : public QObject
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
TimerModel(int iTotalDuration, int iAlertDuration); TimerModel(int iTotalDuration, int iAlertDuration);

View file

@ -37,6 +37,9 @@
using namespace std; using namespace std;
INIT_LOGGER(qt, TrainingWidget);
static const int HIDDEN_COLUMN = 6; static const int HIDDEN_COLUMN = 6;

View file

@ -23,6 +23,7 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include "ui/training_widget.ui.h" #include "ui/training_widget.ui.h"
#include "logging.h"
class QStandardItemModel; class QStandardItemModel;
@ -36,6 +37,7 @@ class PublicGame;
class TrainingWidget: public QWidget, private Ui::TrainingWidget class TrainingWidget: public QWidget, private Ui::TrainingWidget
{ {
Q_OBJECT; Q_OBJECT;
DEFINE_LOGGER();
public: public:
explicit TrainingWidget(QWidget *parent, CoordModel &iCoordModel, PublicGame *iGame); explicit TrainingWidget(QWidget *parent, CoordModel &iCoordModel, PublicGame *iGame);

View file

@ -45,6 +45,9 @@ using boost::format;
using boost::wformat; using boost::wformat;
INIT_LOGGER(utils, GameIO);
#define __UNUSED__ __attribute__((unused)) #define __UNUSED__ __attribute__((unused))
void GameIO::printBoard(ostream &out, const PublicGame &iGame) void GameIO::printBoard(ostream &out, const PublicGame &iGame)

View file

@ -23,6 +23,8 @@
#include <iostream> #include <iostream>
#include "logging.h"
class PublicGame; class PublicGame;
class Results; class Results;
@ -39,6 +41,7 @@ using std::ostream;
*/ */
class GameIO class GameIO
{ {
DEFINE_LOGGER();
public: public:
static void printBoard(ostream &out, const PublicGame &iGame); static void printBoard(ostream &out, const PublicGame &iGame);
static void printBoardDebug(ostream &out, const PublicGame &iGame); static void printBoardDebug(ostream &out, const PublicGame &iGame);

View file

@ -53,6 +53,10 @@
using namespace std; using namespace std;
INIT_LOGGER(utils, Box);
INIT_LOGGER(utils, CursesIntf);
Box::Box(WINDOW *win, int y, int x, int h, int w, Box::Box(WINDOW *win, int y, int x, int h, int w,
unsigned int iHeadingLines) unsigned int iHeadingLines)
: m_win(win), m_x(x), m_y(y), m_w(w), m_h(h), : m_win(win), m_x(x), m_y(y), m_w(w), m_h(h),

View file

@ -23,6 +23,8 @@
#include <ncursesw/curses.h> #include <ncursesw/curses.h>
#include <string> #include <string>
#include "logging.h"
class PublicGame; class PublicGame;
using std::string; using std::string;
@ -31,6 +33,8 @@ using std::wstring;
class Box class Box
{ {
DEFINE_LOGGER();
public: public:
// Create a titled box with the specified position and size, // Create a titled box with the specified position and size,
// containing iHeadingLines non-scrolling lines. // containing iHeadingLines non-scrolling lines.
@ -97,6 +101,7 @@ class Box
*/ */
class CursesIntf class CursesIntf
{ {
DEFINE_LOGGER();
public: public:
// Pre-requisite: the given Game object MUST have been allocated with new // Pre-requisite: the given Game object MUST have been allocated with new
// (in particular: not on the stack) // (in particular: not on the stack)