forked from mirror/openmw-tes3mp
Simplify LOG macros
This commit is contained in:
parent
eedd40328a
commit
e2522fa366
10 changed files with 78 additions and 74 deletions
|
@ -132,13 +132,13 @@ void MasterClient::Update()
|
|||
while (sRun)
|
||||
{
|
||||
if (response == "Created")
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server registered on the master server.", "");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server registered on the master server.");
|
||||
else if (response == "Accepted")
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server updated information about himself on the master server.", "");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Server updated information about himself on the master server.");
|
||||
else if (response == "bad request")
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Update rate is too low, and the master server has deleted information about"
|
||||
" the server. Trying low rate...", "");
|
||||
" the server. Trying low rate...");
|
||||
SetUpdateRate(timeout - step_rate);
|
||||
update = false;
|
||||
}
|
||||
|
|
|
@ -730,7 +730,7 @@ void Networking::newPlayer(RakNet::RakNetGUID guid)
|
|||
}
|
||||
}
|
||||
|
||||
LOG_APPEND(Log::LOG_WARN, "%s", "- Done");
|
||||
LOG_APPEND(Log::LOG_WARN, "- Done");
|
||||
|
||||
}
|
||||
|
||||
|
@ -799,7 +799,7 @@ int Networking::mainLoop()
|
|||
break;
|
||||
case ID_CONNECTION_REQUEST_ACCEPTED: // client to server
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Our connection request has been accepted");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Our connection request has been accepted");
|
||||
break;
|
||||
}
|
||||
case ID_NEW_INCOMING_CONNECTION:
|
||||
|
@ -807,10 +807,10 @@ int Networking::mainLoop()
|
|||
packet->systemAddress.ToString());
|
||||
break;
|
||||
case ID_NO_FREE_INCOMING_CONNECTIONS:
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "The server is full");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "The server is full");
|
||||
break;
|
||||
case ID_DISCONNECTION_NOTIFICATION:
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Client at %s has disconnected",
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Client at %s has disconnected",
|
||||
packet->systemAddress.ToString());
|
||||
disconnectPlayer(packet->guid);
|
||||
break;
|
||||
|
|
|
@ -61,12 +61,12 @@ void GUIFunctions::ListBox(unsigned short pid, int id, const char *label, const
|
|||
|
||||
void GUIFunctions::SetMapVisibility(unsigned short targetPID, unsigned short affectedPID, unsigned short state) noexcept
|
||||
{
|
||||
LOG_MESSAGE(Log::LOG_WARN, "%s", "stub");
|
||||
LOG_MESSAGE(Log::LOG_WARN, "stub");
|
||||
}
|
||||
|
||||
void GUIFunctions::SetMapVisibilityAll(unsigned short targetPID, unsigned short state) noexcept
|
||||
{
|
||||
LOG_MESSAGE(Log::LOG_WARN, "%s", "stub");
|
||||
LOG_MESSAGE(Log::LOG_WARN, "stub");
|
||||
}
|
||||
|
||||
void GUIFunctions::SetConsoleAllow(unsigned short pid, char state)
|
||||
|
|
|
@ -36,7 +36,7 @@ void ItemFunctions::EquipItem(unsigned short pid, unsigned short slot, const cha
|
|||
|
||||
void ItemFunctions::UnequipItem(unsigned short pid, unsigned short slot) noexcept
|
||||
{
|
||||
LOG_MESSAGE(Log::LOG_WARN, "%s", "stub");
|
||||
LOG_MESSAGE(Log::LOG_WARN, "stub");
|
||||
//ItemFunctions::EquipItem(pid, slot, "", 0);
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ void ItemFunctions::RemoveItem(unsigned short pid, const char* itemName, unsigne
|
|||
}
|
||||
void ItemFunctions::GetItemCount(unsigned short pid, const char* itemName) noexcept
|
||||
{
|
||||
LOG_MESSAGE(Log::LOG_WARN, "%s", "stub");
|
||||
LOG_MESSAGE(Log::LOG_WARN, "stub");
|
||||
}
|
||||
|
||||
const char *ItemFunctions::GetItemName(unsigned short pid, unsigned int i) noexcept
|
||||
|
|
|
@ -212,7 +212,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (RakNet::NonNumericHostString(addr.c_str()))
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "%s", "You cannot use non-numeric addresses for the server.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "You cannot use non-numeric addresses for the server.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -229,7 +229,7 @@ int main(int argc, char *argv[])
|
|||
MasterClient *mclient;
|
||||
if (masterEnabled)
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Sharing server query info to master enabled.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sharing server query info to master enabled.");
|
||||
string masterAddr = mgr.getString("address", "MasterServer");
|
||||
int masterPort = mgr.getInt("port", "MasterServer");
|
||||
mclient = new MasterClient(masterAddr, (unsigned short) masterPort, addr, (unsigned short) port);
|
||||
|
@ -251,7 +251,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
if (code == 0)
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Quitting peacefully.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Quitting peacefully.");
|
||||
|
||||
// Restore cout and cerr
|
||||
std::cout.rdbuf(cout_rdbuf);
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace mwmp
|
|||
setVisible(true);
|
||||
}
|
||||
mHistory->addText(color + MyGUI::TextIterator::toTagsString(msg));
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", msg.c_str());
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, msg.c_str());
|
||||
}
|
||||
|
||||
void GUIChat::printOK(const std::string &msg)
|
||||
|
@ -182,7 +182,7 @@ namespace mwmp
|
|||
else // CHAT_ENABLED
|
||||
editState = true;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "%s", "Opening chat.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Opening chat.");
|
||||
SetEditState(editState);
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ bool LocalPlayer::charGenThread()
|
|||
(*Npc()) = *player.get<ESM::NPC>()->mBase;
|
||||
(*BirthSign()) = world->getPlayer().getBirthSign();
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Sending ID_GAME_BASE_INFO to server with my CharGen info");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_GAME_BASE_INFO to server with my CharGen info");
|
||||
getNetworking()->getPlayerPacket(ID_GAME_BASE_INFO)->Send(this);
|
||||
|
||||
// Send stats packets if this is the 2nd round of CharGen that
|
||||
|
@ -333,7 +333,7 @@ void LocalPlayer::updateCell(bool forceUpdate)
|
|||
|
||||
if (cellChanged)
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Sending ID_GAME_CELL to server");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_GAME_CELL to server");
|
||||
|
||||
LOG_APPEND(Log::LOG_INFO, "- Moved from %s to %s",
|
||||
getCell()->getDescription().c_str(),
|
||||
|
|
|
@ -60,7 +60,7 @@ std::string loadSettings (Settings::Manager & settings)
|
|||
|
||||
Main::Main()
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "tes3mp started");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "tes3mp started");
|
||||
mNetworking = new Networking();
|
||||
mLocalPlayer = new LocalPlayer();
|
||||
mGUIController = new GUIController();
|
||||
|
@ -73,7 +73,7 @@ Main::Main()
|
|||
|
||||
Main::~Main()
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "tes3mp stopped");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "tes3mp stopped");
|
||||
delete mNetworking;
|
||||
delete mLocalPlayer;
|
||||
Players::cleanUp();
|
||||
|
@ -184,7 +184,7 @@ void Main::updateWorld(float dt) const
|
|||
if (init)
|
||||
{
|
||||
init = false;
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Sending ID_GAME_BASE_INFO to server");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_GAME_BASE_INFO to server");
|
||||
|
||||
mNetworking->getPlayerPacket(ID_GAME_BASE_INFO)->Send(getLocalPlayer());
|
||||
mNetworking->getPlayerPacket(ID_LOADED)->Send(getLocalPlayer());
|
||||
|
|
|
@ -63,19 +63,19 @@ void Networking::update()
|
|||
switch (packet->data[0])
|
||||
{
|
||||
case ID_REMOTE_DISCONNECTION_NOTIFICATION:
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Another client has disconnected.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Another client has disconnected.");
|
||||
break;
|
||||
case ID_REMOTE_CONNECTION_LOST:
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Another client has lost connection.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Another client has lost connection.");
|
||||
break;
|
||||
case ID_REMOTE_NEW_INCOMING_CONNECTION:
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Another client has connected.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Another client has connected.");
|
||||
break;
|
||||
case ID_CONNECTION_REQUEST_ACCEPTED:
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Our connection request has been accepted.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Our connection request has been accepted.");
|
||||
break;
|
||||
case ID_NEW_INCOMING_CONNECTION:
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "A connection is incoming.");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "A connection is incoming.");
|
||||
break;
|
||||
case ID_NO_FREE_INCOMING_CONNECTIONS:
|
||||
errmsg = "The server is full.";
|
||||
|
@ -95,7 +95,7 @@ void Networking::update()
|
|||
|
||||
if (!errmsg.empty())
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "%s", errmsg.c_str());
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, errmsg.c_str());
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "tes3mp", errmsg.c_str(), 0);
|
||||
MWBase::Environment::get().getStateManager()->requestQuit();
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ void Networking::connect(const std::string &ip, unsigned short port)
|
|||
|
||||
if (!errmsg.empty())
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "%s", errmsg.c_str());
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, errmsg.c_str());
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "tes3mp", errmsg.c_str(), 0);
|
||||
MWBase::Environment::get().getStateManager()->requestQuit();
|
||||
}
|
||||
|
@ -196,21 +196,21 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
|||
}
|
||||
case ID_GAME_BASE_INFO:
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Received ID_GAME_BASE_INFO from server");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_BASE_INFO from server");
|
||||
|
||||
if (guid == myGuid)
|
||||
{
|
||||
LOG_APPEND(Log::LOG_INFO, "%s", "- Packet was about my id");
|
||||
LOG_APPEND(Log::LOG_INFO, "- Packet was about my id");
|
||||
|
||||
if (packet->length == myPacket->headerSize())
|
||||
{
|
||||
LOG_APPEND(Log::LOG_INFO, "%s", "- Requesting info");
|
||||
LOG_APPEND(Log::LOG_INFO, "- Requesting info");
|
||||
myPacket->Send(getLocalPlayer(), serverAddr);
|
||||
}
|
||||
else
|
||||
{
|
||||
myPacket->Packet(&bsIn, getLocalPlayer(), false);
|
||||
LOG_APPEND(Log::LOG_INFO, "%s", "- Updating LocalPlayer");
|
||||
LOG_APPEND(Log::LOG_INFO, "- Updating LocalPlayer");
|
||||
getLocalPlayer()->updateChar();
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
|||
|
||||
if (pl == 0)
|
||||
{
|
||||
LOG_APPEND(Log::LOG_INFO, "%s", "- Exchanging data with new player");
|
||||
LOG_APPEND(Log::LOG_INFO, "- Exchanging data with new player");
|
||||
pl = Players::newPlayer(guid);
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
|||
{
|
||||
if (packet->length != myPacket->headerSize())
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "ID_GAME_POS changed by server");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "ID_GAME_POS changed by server");
|
||||
myPacket->Packet(&bsIn, getLocalPlayer(), false);
|
||||
getLocalPlayer()->setPosition();
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
|||
}
|
||||
case ID_USER_MYID:
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Received ID_USER_MYID from server");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_USER_MYID from server");
|
||||
myGuid = guid;
|
||||
getLocalPlayer()->guid = guid;
|
||||
break;
|
||||
|
@ -434,7 +434,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
|
|||
}
|
||||
case ID_GAME_DIE:
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Received ID_GAME_DIE from server");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_GAME_DIE from server");
|
||||
if (guid == myGuid)
|
||||
{
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||
|
@ -710,7 +710,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_PLACE");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_PLACE");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s\n- count: %i",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -743,7 +743,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_DELETE");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_DELETE");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -768,7 +768,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_LOCK");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_LOCK");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -793,7 +793,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_UNLOCK");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_UNLOCK");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -843,7 +843,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_MOVE");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_MOVE");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -869,7 +869,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_ROTATE");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ROTATE");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -895,7 +895,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_OBJECT_ANIM_PLAY");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_OBJECT_ANIM_PLAY");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -921,7 +921,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_DOOR_ACTIVATE");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_DOOR_ACTIVATE");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -943,7 +943,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
}
|
||||
case ID_VIDEO_PLAY:
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_VIDEO_PLAY");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_VIDEO_PLAY");
|
||||
LOG_APPEND(Log::LOG_WARN, "- video: %s\n- allowSkipping: %s",
|
||||
event->video.c_str(),
|
||||
event->allowSkipping ? "true" : "false");
|
||||
|
@ -958,7 +958,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_SCRIPT_LOCAL_SHORT");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_SHORT");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s\n- index: %i\n- shortVal: %i",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -985,7 +985,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
if (!ptrCellStore) return;
|
||||
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_SCRIPT_LOCAL_FLOAT");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_LOCAL_FLOAT");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s, %i\n- cell: %s\n- index: %i\n- floatVal: %f",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
|
@ -1008,7 +1008,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
}
|
||||
case ID_SCRIPT_MEMBER_SHORT:
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_SCRIPT_MEMBER_SHORT");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_MEMBER_SHORT");
|
||||
LOG_APPEND(Log::LOG_WARN, "- cellRef: %s\n- index: %i\n- shortVal: %i\n",
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->index,
|
||||
|
@ -1035,7 +1035,7 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
}
|
||||
case ID_SCRIPT_GLOBAL_SHORT:
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Received ID_SCRIPT_GLOBAL_SHORT");
|
||||
LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Received ID_SCRIPT_GLOBAL_SHORT");
|
||||
LOG_APPEND(Log::LOG_WARN, "- varName: %s\n- shortVal: %i",
|
||||
event->varName.c_str(),
|
||||
event->shortVal);
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef OPENMW_LOG_HPP
|
||||
#define OPENMW_LOG_HPP
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#if defined(NOLOGS)
|
||||
#define LOG_INIT(logLevel)
|
||||
#define LOG_QUIT()
|
||||
|
@ -13,35 +17,35 @@
|
|||
#else
|
||||
#define LOG_INIT(logLevel) Log::Create(logLevel)
|
||||
#define LOG_QUIT() Log::Delete()
|
||||
#define LOG_MESSAGE(level, msg, ...) Log::Get().print((level), (1), (__FILE__), (__LINE__), (msg), __VA_ARGS__)
|
||||
#define LOG_MESSAGE_SIMPLE(level, msg, ...) Log::Get().print((level), (1), (0), (0), (msg), __VA_ARGS__)
|
||||
#define LOG_APPEND(level, msg, ...) Log::Get().print((level), (0), (0), (0), (msg), __VA_ARGS__)
|
||||
#define LOG_MESSAGE(level, msg, args...) Log::Get().print((level), (1), (__FILE__), (__LINE__), (msg), ##args)
|
||||
#define LOG_MESSAGE_SIMPLE(level, msg, args...) Log::Get().print((level), (1), (0), (0), (msg), ##args)
|
||||
#define LOG_APPEND(level, msg, args...) Log::Get().print((level), (0), (0), (0), (msg), ##args)
|
||||
#endif
|
||||
|
||||
class Log
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
LOG_VERBOSE = 0,
|
||||
LOG_INFO,
|
||||
LOG_WARN,
|
||||
LOG_ERROR,
|
||||
LOG_FATAL
|
||||
};
|
||||
static void Create(int logLevel);
|
||||
static void Delete();
|
||||
static const Log &Get();
|
||||
static void SetLevel(int level);
|
||||
void print(int level, bool hasPrefix, const char *file, int line, const char *message, ...) const;
|
||||
private:
|
||||
Log(int logLevel);
|
||||
/// Not implemented
|
||||
Log( const Log& );
|
||||
/// Not implemented
|
||||
Log& operator=(Log& );
|
||||
static Log *sLog;
|
||||
int logLevel;
|
||||
public:
|
||||
enum
|
||||
{
|
||||
LOG_VERBOSE = 0,
|
||||
LOG_INFO,
|
||||
LOG_WARN,
|
||||
LOG_ERROR,
|
||||
LOG_FATAL
|
||||
};
|
||||
static void Create(int logLevel);
|
||||
static void Delete();
|
||||
static const Log &Get();
|
||||
static void SetLevel(int level);
|
||||
void print(int level, bool hasPrefix, const char *file, int line, const char *message, ...) const;
|
||||
private:
|
||||
Log(int logLevel);
|
||||
/// Not implemented
|
||||
Log(const Log &);
|
||||
/// Not implemented
|
||||
Log &operator=(Log &);
|
||||
static Log *sLog;
|
||||
int logLevel;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue