Created
June 2, 2020 20:15
-
-
Save mlfarrell/940c8768118dac7d98b742916e3e881f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int Logger::Buffer::flushBuffer() | |
{ | |
int num = (int)(pptr()-pbase()); | |
/*if(cout.write(buffer, num) != num) | |
{ | |
return EOF; | |
}*/ | |
#if (defined WIN10_BUILD) || (defined WIN32) | |
static char buf[4096]; | |
memcpy(buf, buffer, num); | |
buf[num] = 0; | |
OutputDebugStringA(buf); | |
#elif defined ANDROID | |
static char buf[4096]; | |
memcpy(buf, buffer, num); | |
buf[num] = 0; | |
__android_log_print(ANDROID_LOG_INFO, "VGLPP", "%s", buf); | |
#endif | |
#ifdef STDOUT_LOGGING | |
cout.write(buffer, num); | |
#else | |
loggerParent.log.write(buffer, num); | |
loggerParent.log << std::flush; | |
#endif | |
pbump(-num); // reset put pointer accordingly | |
return num; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment