Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Glyca/RunicOrbs
base: 688ab1c86a
...
head fork: Glyca/RunicOrbs
compare: 72fb0469a5
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 11 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 25, 2012
@Glyca Added basic log management.
All debug logs are not displayed in release.
Needs optimization.
127708b
@Glyca Modified GameWindow title (The Runic Orbs now) and updated translations. 72fb046
View
BIN  lang/craftux_fr.qm
Binary file not shown
View
124 lang/craftux_fr.ts
@@ -29,55 +29,57 @@
<context>
<name>CraftuxHome</name>
<message>
- <location filename="../src/gui/ui/CraftuxHome.ui" line="32"/>
<source>Welcome to CrafTuX</source>
- <translation>Bienvenue à CrafTuX</translation>
+ <translation type="obsolete">Bienvenue à CrafTuX</translation>
</message>
<message>
- <location filename="../src/gui/ui/CraftuxHome.ui" line="82"/>
<source>Hey, welcome to CrafTuX!</source>
- <translation>Hey, bienvenue à CrafTuX !</translation>
+ <translation type="obsolete">Hey, bienvenue à CrafTuX !</translation>
</message>
<message>
- <location filename="../src/gui/ui/CraftuxHome.ui" line="92"/>
<source>Play &amp;solo</source>
- <translation>Partie &amp;solo</translation>
+ <translation type="obsolete">Partie &amp;solo</translation>
</message>
<message>
- <location filename="../src/gui/ui/CraftuxHome.ui" line="99"/>
<source>Join a &amp;multiplayer game</source>
- <translation>Rejoindre une partie &amp;multijoueur</translation>
+ <translation type="obsolete">Rejoindre une partie &amp;multijoueur</translation>
</message>
<message>
- <location filename="../src/gui/ui/CraftuxHome.ui" line="138"/>
<source>&amp;Host a game</source>
- <translation>&amp;Héberger une partie</translation>
+ <translation type="obsolete">&amp;Héberger une partie</translation>
</message>
<message>
- <location filename="../src/gui/ui/CraftuxHome.ui" line="216"/>
<source>&amp;Options</source>
- <translation>&amp;Options</translation>
+ <translation type="obsolete">&amp;Options</translation>
</message>
<message>
- <location filename="../src/gui/ui/CraftuxHome.ui" line="236"/>
<source>&amp;Quit</source>
- <translation>&amp;Quitter</translation>
+ <translation type="obsolete">&amp;Quitter</translation>
</message>
</context>
<context>
<name>GameWindow</name>
<message>
- <location filename="../src/gui/GameWindow.cpp" line="35"/>
<source>Initialized OpenGL, version %d.%d</source>
- <translation>OpenGL initialisé en version %d.%d</translation>
+ <translation type="obsolete">OpenGL initialisé en version %d.%d</translation>
</message>
<message>
- <location filename="../src/gui/GameWindow.cpp" line="95"/>
+ <location filename="../src/gui/GameWindow.cpp" line="49"/>
+ <source>Initialized OpenGL, version %1.%2</source>
+ <translation>OpenGL initialisé en version %1.%2</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/GameWindow.cpp" line="50"/>
+ <source>OpenGL driver: %1 | %2 | %3 | GL_MAX_TEXTURE_SIZE = %4</source>
+ <translation>Pilote OpenGL : %1 | %2 | %3 | GL_MAX_TEXTURE_SIZE = %4</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/GameWindow.cpp" line="108"/>
<source>FPS</source>
<translation> IPS</translation>
</message>
<message>
- <location filename="../src/gui/GameWindow.cpp" line="97"/>
+ <location filename="../src/gui/GameWindow.cpp" line="110"/>
<source>Position : </source>
<translation>Position : </translation>
</message>
@@ -86,7 +88,7 @@
<translation type="obsolete"> IPS</translation>
</message>
<message>
- <location filename="../src/gui/GameWindow.cpp" line="118"/>
+ <location filename="../src/gui/GameWindow.cpp" line="132"/>
<source>The game is paused
You can resume by pressing ESCAPE or quit with C.</source>
@@ -96,6 +98,54 @@ Vous pouvez reprendre la partie en appuyant sur ECHAP ou quitter avec C.</transl
</message>
</context>
<context>
+ <name>Home</name>
+ <message>
+ <location filename="../src/gui/ui/Home.ui" line="26"/>
+ <source>Welcome to The Runic Orbs</source>
+ <translation>Bienvenue à The Runic Orbs</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/ui/Home.ui" line="41"/>
+ <source>The Runic Orbs</source>
+ <translation>The Runic Orbs</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/ui/Home.ui" line="61"/>
+ <source>http://www.runicorbs.net/</source>
+ <translation>http://www.runicorbs.net/</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/ui/Home.ui" line="80"/>
+ <source>Play &amp;solo</source>
+ <translation>Partie &amp;solo</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/ui/Home.ui" line="87"/>
+ <source>Join a &amp;multiplayer game</source>
+ <translation>Rejoindre une partie &amp;multijoueur</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/ui/Home.ui" line="94"/>
+ <source>&amp;Host a game</source>
+ <translation>&amp;Héberger une partie</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/ui/Home.ui" line="101"/>
+ <source>&amp;Options</source>
+ <translation>&amp;Options</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/ui/Home.ui" line="289"/>
+ <source>&amp;Quit</source>
+ <translation>&amp;Quitter</translation>
+ </message>
+ <message>
+ <location filename="../src/gui/ui/Home.cpp" line="23"/>
+ <source>version %1</source>
+ <translation>version %1</translation>
+ </message>
+</context>
+<context>
<name>OptionsDialog</name>
<message>
<location filename="../src/gui/ui/OptionsDialog.ui" line="18"/>
@@ -242,61 +292,57 @@ Vous pouvez reprendre la partie en appuyant sur ECHAP ou quitter avec C.</transl
<translation>Impossible d&apos;analyser le fichier de configuration %1</translation>
</message>
<message>
- <location filename="../src/ClientConfiguration.cpp" line="187"/>
+ <location filename="../src/ClientConfiguration.cpp" line="191"/>
<source>This is the Craftux configuration file</source>
<translation>Ceci est le fichier de configuration de Craftux</translation>
</message>
<message>
- <location filename="../src/ClientConfiguration.cpp" line="195"/>
+ <location filename="../src/ClientConfiguration.cpp" line="199"/>
<source>Settings for gameplay</source>
<translation>Paramètres de jeu</translation>
</message>
<message>
- <location filename="../src/ClientConfiguration.cpp" line="205"/>
+ <location filename="../src/ClientConfiguration.cpp" line="209"/>
<source>Configure graphics</source>
<translation>Configuration des graphismes</translation>
</message>
<message>
- <location filename="../src/ClientConfiguration.cpp" line="215"/>
+ <location filename="../src/ClientConfiguration.cpp" line="219"/>
<source>Configure keymap</source>
<translation>Mappage des touches</translation>
</message>
<message>
- <location filename="../src/ClientConfiguration.cpp" line="218"/>
+ <location filename="../src/ClientConfiguration.cpp" line="222"/>
<source>Configure movement key</source>
<translation>Mappage des touches du déplacement</translation>
</message>
<message>
- <location filename="../src/ClientConfiguration.cpp" line="261"/>
+ <location filename="../src/ClientConfiguration.cpp" line="265"/>
<source>Error opening client configuration file %1</source>
<translation>Erreur lors de l&apos;ouverture du fichier de configuration %1</translation>
</message>
<message>
- <location filename="../src/main.cpp" line="16"/>
<source>[Debug] %s
</source>
- <translation>[Debug] %s
+ <translation type="obsolete">[Debug] %s
</translation>
</message>
<message>
- <location filename="../src/main.cpp" line="19"/>
<source>[Warning] %s
</source>
- <translation>[Avertissement] %s
+ <translation type="obsolete">[Avertissement] %s
</translation>
</message>
<message>
- <location filename="../src/main.cpp" line="22"/>
<source>[Critical] %s
</source>
- <translation>[Critique] %s
+ <translation type="obsolete">[Critique] %s
</translation>
</message>
<message>
- <location filename="../src/main.cpp" line="25"/>
<source>[Fatal] %s
</source>
- <translation>[Fatal] %s
+ <translation type="obsolete">[Fatal] %s
</translation>
</message>
<message>
@@ -304,32 +350,32 @@ Vous pouvez reprendre la partie en appuyant sur ECHAP ou quitter avec C.</transl
<translation type="obsolete">Le chargement de la texture [%1] a échoué !</translation>
</message>
<message>
- <location filename="../src/blocks/Blocks.cpp" line="27"/>
+ <location filename="../src/blocks/Blocks.cpp" line="28"/>
<source>Blocks catalog created, having %1 blocks.</source>
<translation>Catalogue des blocs créé, il contient %1 blocs.</translation>
</message>
<message>
- <location filename="../src/gui/TextureManager.cpp" line="26"/>
+ <location filename="../src/gui/TextureManager.cpp" line="27"/>
<source>Texture loading [%1] for &quot;%2&quot; failed!</source>
<translation>Le chargement de la texture [%1] du bloc &quot;%2&quot; a échoué !</translation>
</message>
<message>
- <location filename="../src/gui/TextureManager.cpp" line="27"/>
+ <location filename="../src/gui/TextureManager.cpp" line="28"/>
<source>Successfully loaded &quot;%1&quot; texture [%2].</source>
<translation>Chargé la texture [%2] du bloc &quot;%1&quot; !</translation>
</message>
<message>
- <location filename="../src/gui/TextureManager.cpp" line="125"/>
+ <location filename="../src/gui/TextureManager.cpp" line="126"/>
<source>Textures loaded!</source>
<translation>Textures chargées !</translation>
</message>
<message>
- <location filename="../src/gui/TextureManager.cpp" line="143"/>
+ <location filename="../src/gui/TextureManager.cpp" line="144"/>
<source>Item image loading [%1] for &quot;%2&quot; failed!</source>
<translation>Le chargement de l&apos;image [%1] du bloc &quot;%2&quot; a échoué !</translation>
</message>
<message>
- <location filename="../src/gui/TextureManager.cpp" line="144"/>
+ <location filename="../src/gui/TextureManager.cpp" line="145"/>
<source>Successfully loaded &quot;%1&quot; item image [%2].</source>
<translation>Chargé l&apos;image [%2] du bloc &quot;%1&quot; !</translation>
</message>
View
113 src/Log.cpp
@@ -1,13 +1,120 @@
#include "Log.h"
+#include <cstdlib> // abort()
+
+void qtMessageOutput(QtMsgType type, const char* msg)
+{
+ switch (type) {
+ case QtDebugMsg:
+ ldebug(Channel_Qt, std::string(msg));
+ break;
+ case QtWarningMsg:
+ lwarning(Channel_Qt, std::string(msg));
+ break;
+ case QtCriticalMsg:
+ lerror(Channel_Qt, std::string(msg));
+ break;
+ case QtFatalMsg:
+ lerror(Channel_Qt, std::string(msg));
+ lwarning(Channel_Global, std::string("The error is unrecoverable, program will abort! :("));
+ abort();
+ }
+}
Log::Log()
{
+ qInstallMsgHandler(qtMessageOutput);
}
-void Log::print(const std::string& string)
+Log::~Log()
{
- std::list<std::ostream>::iterator it(instance().m_ostreams.begin()), eit(instance().m_ostreams.end());
+
+}
+
+void Log::printLine(const std::string& string)
+{
+ std::list<std::ostream*>::iterator it(instance().m_ostreams.begin()), eit(instance().m_ostreams.end());
for(; it != eit; ++it) {
- it->write(string.c_str(), string.size());
+ (*it)->write(string.c_str(), string.size());
+ (*it)->put('\n');
+ (*it)->flush();
+ }
+}
+
+void Log::debugLine(const std::string& string, const LogChannel channel)
+{
+ printLine(std::string("[Debug/") + std::string(channelString(channel)) + std::string("] ") + string);
+}
+void Log::debugLine(const QString& string, const LogChannel channel)
+{
+ debugLine(string.toStdString(), channel);
+}
+void Log::debugLine(const char* string, const LogChannel channel)
+{
+ debugLine(std::string(string), channel);
+}
+
+void Log::infoLine(const std::string& string, const LogChannel channel)
+{
+ printLine(std::string("[Info/") + std::string(channelString(channel)) + std::string("] ") + string);
+}
+void Log::infoLine(const QString& string, const LogChannel channel)
+{
+ infoLine(string.toStdString(), channel);
+}
+void Log::infoLine(const char* string, const LogChannel channel)
+{
+ infoLine(std::string(string), channel);
+}
+
+void Log::warningLine(const std::string& string, const LogChannel channel)
+{
+ printLine(std::string("[WARNING/") + std::string(channelString(channel)) + std::string("] ") + string);
+}
+void Log::warningLine(const QString& string, const LogChannel channel)
+{
+ warningLine(string.toStdString(), channel);
+}
+void Log::warningLine(const char* string, const LogChannel channel)
+{
+ warningLine(std::string(string), channel);
+}
+
+void Log::errorLine(const std::string& string, const LogChannel channel)
+{
+ printLine(std::string("[ERROR/") + std::string(channelString(channel)) + std::string("] ") + string);
+}
+void Log::errorLine(const QString& string, const LogChannel channel)
+{
+ errorLine(string.toStdString(), channel);
+}
+void Log::errorLine(const char* string, const LogChannel channel)
+{
+ errorLine(std::string(string), channel);
+}
+
+void Log::plugOutputStream(std::ostream* stream)
+{
+ instance().m_ostreams.push_back(stream);
+}
+
+const char* Log::channelString(const LogChannel channel)
+{
+ switch(channel) {
+ case Channel_Global:
+ return "Global";
+ case Channel_Qt:
+ return "Qt";
+ case Channel_Server:
+ return "Server";
+ case Channel_Physic:
+ return "Physic";
+ case Channel_Textures:
+ return "Textures";
+ case Channel_OpenGL:
+ return "OpenGL";
+ case Channel_Blocks:
+ return "Blocks";
+ default:
+ return "Global";
}
}
View
60 src/Log.h
@@ -3,31 +3,71 @@
#include <list>
#include <ostream>
+#include <QString>
-/*! Static singloton class for logging */
+/*! Channels available */
+enum LogChannel {
+ Channel_Global,
+ Channel_Qt,
+ Channel_Server,
+ Channel_Physic,
+ Channel_Textures,
+ Channel_OpenGL,
+ Channel_Blocks
+};
+
+/*! Singloton class for logging */
class Log
{
public:
Log();
+ ~Log();
+
+ static void printLine(const std::string& string);
+
+ static void debugLine(const std::string& string, const LogChannel channel = Channel_Global);
+ static void debugLine(const QString& string, const LogChannel channel = Channel_Global);
+ static void debugLine(const char* string, const LogChannel channel = Channel_Global);
+
+ static void infoLine(const std::string& string, const LogChannel channel = Channel_Global);
+ static void infoLine(const QString& string, const LogChannel channel = Channel_Global);
+ static void infoLine(const char* string, const LogChannel channel = Channel_Global);
- /*! Channels available */
- enum Channel {
- Channel_Debug,
- Channel_Warning
- };
+ static void warningLine(const std::string& string, const LogChannel channel = Channel_Global);
+ static void warningLine(const QString& string, const LogChannel channel = Channel_Global);
+ static void warningLine(const char* string, const LogChannel channel = Channel_Global);
- static void print(const std::string& string);
+ static void errorLine(const std::string& string, const LogChannel channel = Channel_Global);
+ static void errorLine(const QString& string, const LogChannel channel = Channel_Global);
+ static void errorLine(const char* string, const LogChannel channel = Channel_Global);
/*! Plug an ostream on which the log will print */
- static void plugOutputStream(const std::ostream& stream);
+ static void plugOutputStream(std::ostream* stream);
private:
- static Log& instance() {
+ inline static Log& instance() {
static Log log;
return log;
}
- std::list<std::ostream> m_ostreams; //!< All ostreams we have to print on
+ static const char* channelString(const LogChannel channel);
+
+ std::list<std::ostream*> m_ostreams; //!< All ostreams we have to print on
};
+template<typename T>
+inline std::basic_ostream<T>& operator<<(std::basic_ostream<T>& os, const QString& str) {
+ return os << qPrintable(str);
+}
+
+#ifndef QT_NO_DEBUG
+#define ldebug(channel, string) (Log::debugLine(string, channel))
+#else
+#define ldebug(channel, string)
+#endif
+
+#define linfo(channel, string) (Log::infoLine(string, channel))
+#define lwarning(channel, string) (Log::warningLine(string, channel))
+#define lerror(channel, string) (Log::errorLine(string, channel))
+
#endif // LOG_H
View
1  src/PhysicEngine.cpp
@@ -5,7 +5,6 @@ PhysicEngine::PhysicEngine(World* world, QObject *parent) : QObject(parent), m_w
{
m_physicObjects.reserve(16);
m_elapsedTimer.start();
- qDebug("PhysicEngine created (currently have %d PhysicObjects)", m_physicObjects.count());
}
PhysicObject* PhysicEngine::createPhysicObject(preal mass)
View
3  src/PhysicObject.cpp
@@ -1,5 +1,6 @@
#include "PhysicObject.h"
#include "blocks/BlockDescriptor.h"
+#include "Log.h"
#include "server/Server.h"
#include "World.h"
@@ -84,7 +85,7 @@ void PhysicObject::destuck()
v_position.y = (preal)world()->altitude(v_position.x, v_position.z) + 0.01;
v_velocity.null();
v_acceleration.null();
- qDebug() << "destucked : set at" << v_position.y;
+ ldebug(Channel_Physic, "destucked : set at " + QString::number(v_position.y));
}
}
View
3  src/blocks/Blocks.cpp
@@ -1,6 +1,7 @@
#include "Blocks.h"
#include "BlockDescriptor.h"
#include "CubeBlock.h"
+#include "Log.h"
#include "TorchBlock.h"
const bool B_BREAKABLE = true, B_UNBREAKABLE = false;
@@ -24,7 +25,7 @@ Blocks::Blocks()
m_blockDescriptors[2] = &Blocks::DIRT;
m_blockDescriptors[3] = &Blocks::GRASS;
m_blockDescriptors[4] = &Blocks::TORCH;
- qDebug() << QObject::tr("Blocks catalog created, having %1 blocks.").arg(MAX_BLOCKID).toStdString().c_str();
+ linfo(Channel_Blocks, QObject::tr("Blocks catalog created, having %1 blocks.").arg(MAX_BLOCKID));
}
BlockDescriptor& Blocks::byId(const int id)
View
9 src/gui/GameWindow.cpp
@@ -1,6 +1,7 @@
#include "GameWindow.h"
#include "blocks/TorchBlock.h"
#include "ClientConfiguration.h"
+#include "Log.h"
#include "OpenGLBuffer.h"
#include "PhysicEngine.h"
#include "ServerConnector.h"
@@ -17,7 +18,7 @@ GameWindow::GameWindow(ServerConnector* connector)
m_textureManager.setTextureFiltering((TextureManager::TextureFiltering)m_configuration->getTextureFiltering());
setFps(m_configuration->getFps());
setAutoFillBackground(false);
- setWindowTitle("CrafTuX");
+ setWindowTitle("The Runic Orbs");
// Give us 10 torches to survive
m_connector->me()->give(Blocks::TORCH.id(), 10);
@@ -45,8 +46,8 @@ GameWindow::~GameWindow()
void GameWindow::initializeGL()
{
GLint maxTextureSize; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
- qDebug(tr("Initialized OpenGL, version %d.%d").toAscii(), format().majorVersion(), format().minorVersion());
- qDebug() << "OpenGL driver :" << (const char*)glGetString(GL_VENDOR) << "|" << (const char*)glGetString(GL_RENDERER)<< "|" << (const char*)glGetString(GL_VERSION) << "| GL_MAX_TEXTURE_SIZE =" << maxTextureSize;
+ linfo(Channel_OpenGL, tr("Initialized OpenGL, version %1.%2").arg(format().majorVersion()).arg(format().minorVersion()));
+ linfo(Channel_OpenGL, tr("OpenGL driver: %1 | %2 | %3 | GL_MAX_TEXTURE_SIZE = %4").arg((const char*)glGetString(GL_VENDOR)).arg((const char*)glGetString(GL_RENDERER)).arg((const char*)glGetString(GL_VERSION)).arg(maxTextureSize));
m_textureManager.loadTextures();
@@ -104,7 +105,7 @@ void GameWindow::render2D(QPainter& painter)
painter.setPen(Qt::white);
if(b_playing) {
- QString text = QString("CrafTuX version " TRO_VERSION " @ ") + QString::number(getCurrentFPS()) + tr("FPS");
+ QString text = QString("The Runic Orbs version " TRO_VERSION " @ ") + QString::number(getCurrentFPS()) + tr("FPS");
if(b_debugView) {
text.append("\n\n" + tr("Position : ") + m_connector->me()->v_position);
text.append("\n" "Pitch : " + QString::number(m_connector->me()->pitch()) + " // Yaw : " + QString::number(m_connector->me()->yaw()));
View
11 src/gui/TextureManager.cpp
@@ -1,6 +1,7 @@
#include "TextureManager.h"
#include "blocks/Blocks.h"
#include "blocks/BlockDescriptor.h"
+#include "Log.h"
#include <QtGlobal>
const char* TEXTURE_PATH = "/gfx/textures/";
@@ -37,11 +38,11 @@ QImage TextureManager::getTextureAtlas()
QString textureFilename(qApp->applicationDirPath() + TEXTURE_PATH + Blocks::byId(blockID).name() + ".png");
QImage qim_texture(textureFilename);
if(qim_texture.isNull()) {
- qDebug() << errorString.arg(textureFilename, Blocks::byId(blockID).name()).toStdString().c_str();
+ lwarning(Channel_Textures, errorString.arg(textureFilename, Blocks::byId(blockID).name()));
}
else {
qmap_textureImages.insert(blockID, qim_texture);
- qDebug() << loadedString.arg(Blocks::byId(blockID).name(), textureFilename).toStdString().c_str();
+ ldebug(Channel_Textures, loadedString.arg(Blocks::byId(blockID).name(), textureFilename));
// The atlas width is the greater width of all textures
if(qim_texture.width() > atlasWidth) {
atlasWidth = qim_texture.width();
@@ -122,7 +123,7 @@ GLuint TextureManager::loadTextures()
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, qim_Texture.width(), qim_Texture.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, qim_Texture.bits());
}
- qDebug() << QObject::tr("Textures loaded!").toStdString().c_str();
+ linfo(Channel_Textures, QObject::tr("Textures loaded!"));
return gi_textureID;
}
@@ -148,11 +149,11 @@ void TextureManager::loadItemImages()
QString itemImageFilename(qApp->applicationDirPath() + ITEMS_IMAGES_PATH + Blocks::byId(blockID).name() + ".png");
QImage qim_itemImage(itemImageFilename);
if(qim_itemImage.isNull()) {
- qDebug() << errorString.arg(itemImageFilename, Blocks::byId(blockID).name()).toStdString().c_str();
+ lwarning(Channel_Textures, errorString.arg(itemImageFilename, Blocks::byId(blockID).name()));
}
else {
Blocks::byId(blockID).setItemImage(qim_itemImage);
- qDebug() << loadedString.arg(Blocks::byId(blockID).name(), itemImageFilename).toStdString().c_str();
+ ldebug(Channel_Textures, loadedString.arg(Blocks::byId(blockID).name(), itemImageFilename));
}
}
}
View
28 src/main.cpp
@@ -1,6 +1,5 @@
-#include <cstdio>
-#include <cstdlib>
-#include <ctime>
+#include <ctime>
+#include <iostream> // std::cout
#include <QLibraryInfo>
#include <QLocale>
#include <QTextCodec>
@@ -8,24 +7,7 @@
#include <QtGui/QApplication>
#include "gui/ui/Home.h"
-
-void craftuxMessageOutput(QtMsgType type, const char* msg)
-{
- switch (type) {
- case QtDebugMsg:
- fprintf(stderr, QObject::tr("[Debug] %s\n").toAscii(), msg);
- break;
- case QtWarningMsg:
- fprintf(stderr, QObject::tr("[Warning] %s\n").toAscii(), msg);
- break;
- case QtCriticalMsg:
- fprintf(stderr, QObject::tr("[Critical] %s\n").toAscii(), msg);
- break;
- case QtFatalMsg:
- fprintf(stderr, QObject::tr("[Fatal] %s\n").toAscii(), msg);
- abort();
- }
-}
+#include "Log.h"
int main(int argc, char *argv[])
{
@@ -36,8 +18,7 @@ int main(int argc, char *argv[])
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
- qInstallMsgHandler(craftuxMessageOutput);
-
+ Log::plugOutputStream(&std::cout); // Make the log be put in std::cout
QApplication a(argc, argv);
QTranslator qtTranslator;
@@ -51,6 +32,5 @@ int main(int argc, char *argv[])
Home w;
w.show();
-
return a.exec();
}
View
3  src/server/Server.cpp
@@ -1,9 +1,10 @@
+#include "Log.h"
#include "Server.h"
#include "version.h"
Server::Server(QObject *parent) : QObject(parent), i_nextPhysicObjectId(10)
{
- qDebug("Starting TRO server version " TRO_VERSION " ...");
+ linfo(Channel_Server, "Starting TRO server version " TRO_VERSION " ...");
}
const PhysicObject* Server::po(const int id) const

No commit comments for this range

Something went wrong with that request. Please try again.