Core/Misc: Minor optimizations (+code changes to reduce differences with 4.3.4 branch)

Core/Logging: Create new logger type "Cheat". Will be used to log all cheat attempts
This commit is contained in:
Spp
2013-03-25 13:26:48 +01:00
parent 7c36e3a298
commit 1a6a23ec96
42 changed files with 375 additions and 312 deletions
+38
View File
@@ -0,0 +1,38 @@
#include "Errors.h"
#include "Log.h"
#include <ace/Stack_Trace.h>
#include <ace/OS_NS_unistd.h>
namespace Trinity {
void Assert(char const *file, int line, char const *function, char const *message)
{
ACE_Stack_Trace st;
fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n",
file, line, function, message, st.c_str());
*((volatile int*)NULL) = 0;
}
void Fatal(char const *file, int line, char const *function, char const *message)
{
sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s FATAL ERROR:\n %s\n",
file, line, function, message);
ACE_OS::sleep(10);
*((volatile int*)NULL) = 0;
}
void Error(char const *file, int line, char const *function, char const *message)
{
sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s ERROR:\n %s\n",
file, line, function, message);
*((volatile int*)NULL) = 0;
}
void Warning(char const *file, int line, char const *function, char const *message)
{
sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s WARNING:\n %s\n",
file, line, function, message);
}
} // namespace Trinity