Core/Logging: Add new function to include full stacktrace.

Note: It only has use for devs but makes it easier to get the error with a full trace
This commit is contained in:
Spp
2011-09-26 14:34:50 +02:00
parent 8484b004dd
commit 7b68a6bf69
2 changed files with 13 additions and 0 deletions

View File

@@ -1039,3 +1039,15 @@ void Log::outChat(const char * str, ...)
va_end(ap);
}
}
void Log::outErrorST(const char * str, ...)
{
va_list ap;
va_start(ap, str);
char nnew_str[MAX_QUERY_LEN];
vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap);
va_end(ap);
ACE_Stack_Trace st;
outError("%s [Stacktrace: %s]", nnew_str, st.c_str());
}

View File

@@ -114,6 +114,7 @@ class Log
void SetColor(bool stdout_stream, ColorTypes color);
void ResetColor(bool stdout_stream);
void outErrorST( const char * err, ... ) ATTR_PRINTF(2, 3);
void outDB( LogTypes type, const char * str );
void outString( const char * str, ... ) ATTR_PRINTF(2, 3);
void outString( );