From 978d45ddefd4bc906869bb1303de3210ccb0f6d0 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Sun, 23 Oct 2016 10:56:11 -0700 Subject: [PATCH] Forward gLogger output to adb on android platforms Reviewed By: splhack Differential Revision: D4064619 fbshipit-source-id: de23e72844e25106d0db756064f5699959f45ed2 --- React/CSSLayout/CSSLayout.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/React/CSSLayout/CSSLayout.c b/React/CSSLayout/CSSLayout.c index aec8d89a3..c8f2d71bd 100644 --- a/React/CSSLayout/CSSLayout.c +++ b/React/CSSLayout/CSSLayout.c @@ -98,7 +98,19 @@ typedef struct CSSNode { static void _CSSNodeMarkDirty(const CSSNodeRef node); +#ifdef ANDROID +#include +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; +#endif static float computedEdgeValue(const float edges[CSSEdgeCount], const CSSEdge edge,