Forward gLogger output to adb on android platforms

Reviewed By: splhack

Differential Revision: D4064619

fbshipit-source-id: de23e72844e25106d0db756064f5699959f45ed2
This commit is contained in:
Emil Sjolander 2016-10-23 10:56:11 -07:00 committed by Facebook Github Bot
parent 487171fd89
commit 978d45ddef
1 changed files with 12 additions and 0 deletions

View File

@ -98,7 +98,19 @@ typedef struct CSSNode {
static void _CSSNodeMarkDirty(const CSSNodeRef node); static void _CSSNodeMarkDirty(const CSSNodeRef node);
#ifdef ANDROID
#include <android/log.h>
static int _csslayoutAndroidLog(const char *format, ...) {
va_list args;
va_start(args, format);
const int result = __android_log_vprint(ANDROID_LOG_DEBUG, "css-layout", format, args);
va_end(args);
return result;
}
static CSSLogger gLogger = &_csslayoutAndroidLog;
#else
static CSSLogger gLogger = &printf; static CSSLogger gLogger = &printf;
#endif
static float computedEdgeValue(const float edges[CSSEdgeCount], static float computedEdgeValue(const float edges[CSSEdgeCount],
const CSSEdge edge, const CSSEdge edge,