Factor out SONAR_LOG

Reviewed By: passy

Differential Revision: D9555739

fbshipit-source-id: 022763ea03047e1c4cd88d5f389b66be4cbe416b
This commit is contained in:
John Knox
2018-09-03 11:10:59 -07:00
committed by Facebook Github Bot
parent 243b4207e7
commit 9939a9e3bb
5 changed files with 48 additions and 41 deletions

20
xplat/Sonar/Log.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include "Log.h"
#ifdef __ANDROID__
#include <android/log.h>
#endif
namespace facebook {
namespace sonar {
void log(const std::string& message) {
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_INFO, "sonar", "sonar: %s", message.c_str());
#else
printf("sonar: %s\n", message.c_str());
#endif
}
} // namespace sonar
} // namespace facebook