MCPcopy Create free account
hub / github.com/bwapi/bwapi / vBWAPIError

Function vBWAPIError

bwapi/BWAPI/Source/DLLMain.cpp:98–117  ·  view source on GitHub ↗

------------------------------------------------ BWAPI ERROR -----------------------------------------------

Source from the content-addressed store, hash-verified

96
97//------------------------------------------------ BWAPI ERROR -----------------------------------------------
98void vBWAPIError(const char *format, va_list arg)
99{
100 // Expand format
101 char buffer[256];
102 VSNPrintf(buffer, format, arg);
103
104 // Send error message to Broodwar
105 BWAPI::Broodwar << BWAPI::Text::Red << "ERROR: " << buffer << std::endl;
106
107 // Retrieve system time
108 SYSTEMTIME time;
109 GetSystemTime(&time);
110
111 FILE *log = fopen("Errors/bwapi-error.txt", "a+");
112 if ( log )
113 {
114 fprintf(log, "[%u/%02u/%02u - %02u:%02u:%02u] %s\n", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond, buffer);
115 fclose(log);
116 }
117}
118void BWAPIError(const char *format, ...)
119{
120 va_list ap;

Callers 1

BWAPIErrorFunction · 0.85

Calls 1

VSNPrintfFunction · 0.50

Tested by

no test coverage detected