void Sys_Error (const char *error, ...) { va_list argptr; char text[MAX_PRINTMSG]; va_start (argptr, error); q_vsnprintf (text, sizeof(text), error, argptr); va_end (argptr); if (con_debuglog) { LOG_Print (ERROR_PREFIX); LOG_Print (text); LOG_Print ("\n\n"); } Host_Shutdown (); printf (ERROR_PREFIX "%s\n\n", text); #ifdef DEBUG_BUILD getch(); #endif exit (1); }
static void LOG_Exception(const char *szFunction) { if (nLogEnabled) { char szMessage[MAX_LOG]; sprintf(szMessage, "EXCEPTION FOUND IN '%s'", szFunction); LOG_Print(szMessage); } }
static void LOG_Parameters(const char *szFunction, const char *szParameters) { if (nLogEnabled && (nLogFunction & LOG_FUNCTION_PARAMETERS)) { char szMessage[MAX_LOG]; sprintf(szMessage, "PARAMETERS of %s: %s", szFunction, szParameters); LOG_Print(szMessage); } }
static void LOG_EnteringTo(const char *szFunction) { if (nLogEnabled && (nLogFunction & LOG_FUNCTION_ENTRY)) { char szMessage[MAX_LOG]; sprintf(szMessage, "ENTRY '%s'", szFunction); LOG_Print(szMessage); } }
static void LOG_LeavingFrom(const char *szFunction, TPCANStatus Result) { if (nLogEnabled && (nLogFunction & LOG_FUNCTION_LEAVE)) { char szMessage[MAX_LOG]; sprintf(szMessage, "EXIT '%s' - RESULT: 0x%02X", szFunction, (unsigned int) Result); LOG_Print(szMessage); } }
void Sys_Error (const char *error, ...) { va_list argptr; char text[MAX_PRINTMSG]; va_start (argptr, error); q_vsnprintf (text, sizeof(text), error, argptr); va_end (argptr); if (con_debuglog) { LOG_Print (ERROR_PREFIX); LOG_Print (text); LOG_Print ("\n\n"); } Sys_EnableTerm(); Host_Shutdown (); fprintf(stderr, ERROR_PREFIX "%s\n\n", text); // Sys_AtExit is called by exit to shutdown the system exit (1); }
void CONSOLE_PrintNoCRLF( const string &message, bool log ) { gMainBuffer.push_back( message ); if( gMainBuffer.size( ) > 100 ) gMainBuffer.erase( gMainBuffer.begin( ) ); gMainWindowChanged = true; CONSOLE_Draw( ); if( log && gLog ) LOG_Print( message ); if( !gCurses ) cout << message; }
static void LOG_Channel(TPCANHandle Channel, int nFunction, TPCANMsg* MessageBuffer) { if (nLogEnabled && (nLogFunction & nFunction) && MessageBuffer) { char szMessage[MAX_LOG]; sprintf( szMessage, "CHANNEL 0x%02X (%s) ID=0x%X Len=%u, Data=0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X", (unsigned int) Channel, nFunction == LOG_FUNCTION_WRITE ? "OUT" : "IN", (unsigned int) MessageBuffer->ID, (unsigned int) MessageBuffer->LEN, (unsigned int) MessageBuffer->DATA[0], (unsigned int) MessageBuffer->DATA[1], (unsigned int) MessageBuffer->DATA[2], (unsigned int) MessageBuffer->DATA[3], (unsigned int) MessageBuffer->DATA[4], (unsigned int) MessageBuffer->DATA[5], (unsigned int) MessageBuffer->DATA[6], (unsigned int) MessageBuffer->DATA[7]); LOG_Print(szMessage); } }
static void LOG_PrintClose() { LOG_Print("«____________________________________»"); LOG_Print("« ############ »"); LOG_Print("«____________________________________»"); }
static void LOG_PrintOpen() { LOG_Print("«____________________________________»"); LOG_Print("« PCAN-Basic Log »"); LOG_Print("«____________________________________»"); }