Move YGLogger into YGConfig and associate YGNodeRef with log events

Summary:
Moves the `YGLogger` into `YGConfig` and pass the `YGNodeRef` into the logger to be able to associate the log messages and assertions with the specific node.

Tackles facebook/yoga#530 and facebook/yoga#446
Closes https://github.com/facebook/yoga/pull/531

Reviewed By: astreet

Differential Revision: D4970149

Pulled By: emilsjolander

fbshipit-source-id: b7fcdaa273143ea2fa35861620b2e4d79f04f0af
This commit is contained in:
Lukas Wöhrl
2017-05-03 09:22:35 -07:00
committed by Facebook Github Bot
parent 40eba60cf5
commit 91230ae177
36 changed files with 863 additions and 606 deletions

View File

@@ -24,7 +24,7 @@
#endif
#ifdef WINARMDLL
#define WIN_STRUCT(type) type*
#define WIN_STRUCT(type) type *
#define WIN_STRUCT_REF(value) &value
#else
#define WIN_STRUCT(type) type
@@ -35,20 +35,6 @@
#define FB_ASSERTIONS_ENABLED 1
#endif
#if FB_ASSERTIONS_ENABLED
#define YG_ABORT() abort()
#else
#define YG_ABORT()
#endif
#ifndef YG_ASSERT
#define YG_ASSERT(X, message) \
if (!(X)) { \
YGLog(YGLogLevelError, "%s", message); \
YG_ABORT(); \
}
#endif
#ifdef NS_ENUM
// Cannot use NSInteger as NSInteger has a different size than int (which is the default type of a
// enum).