Direct log output to __android_log_print

This commit is contained in:
baldurk
2016-06-17 13:52:48 +02:00
parent ad2b266f95
commit dc1c7323e6
3 changed files with 27 additions and 11 deletions
@@ -22,8 +22,11 @@
* THE SOFTWARE.
******************************************************************************/
#include <android/log.h>
#include "os/os_specific.h"
#define LOGCAT_TAG "renderdoc"
typedef int Display;
namespace Keyboard
@@ -79,3 +82,16 @@ string Wide2UTF8(const std::wstring &s)
return "";
}
};
namespace OSUtility
{
void WriteOutput(int channel, const char *str)
{
if(channel == OSUtility::Output_StdOut)
fprintf(stdout, "%s", str);
else if(channel == OSUtility::Output_StdErr)
fprintf(stderr, "%s", str);
else if(channel == OSUtility::Output_DebugMon)
__android_log_print(ANDROID_LOG_INFO, LOGCAT_TAG, "%s", str);
}
};
@@ -218,3 +218,14 @@ string Wide2UTF8(const std::wstring &s)
return string(&charBuffer[0]);
}
};
namespace OSUtility
{
void WriteOutput(int channel, const char *str)
{
if(channel == OSUtility::Output_StdOut)
fprintf(stdout, "%s", str);
else if(channel == OSUtility::Output_StdErr)
fprintf(stderr, "%s", str);
}
};
-11
View File
@@ -314,14 +314,3 @@ string Fmt(const char *format, ...)
return ret;
}
};
namespace OSUtility
{
void WriteOutput(int channel, const char *str)
{
if(channel == OSUtility::Output_StdOut)
fprintf(stdout, "%s", str);
else if(channel == OSUtility::Output_StdErr)
fprintf(stderr, "%s", str);
}
};