diff --git a/React/Base/RCTLog.m b/React/Base/RCTLog.m index e34502f3b..25ad49e85 100644 --- a/React/Base/RCTLog.m +++ b/React/Base/RCTLog.m @@ -9,6 +9,8 @@ #import "RCTLog.h" +#include + #import "RCTAssert.h" #import "RCTBridge.h" #import "RCTDefines.h" @@ -57,6 +59,25 @@ RCTLogFunction RCTDefaultLogFunction = ^( ); fprintf(stderr, "%s\n", log.UTF8String); fflush(stderr); + + int aslLevel = ASL_LEVEL_ERR; + switch(level) { + case RCTLogLevelInfo: + aslLevel = ASL_LEVEL_NOTICE; + break; + case RCTLogLevelWarning: + aslLevel = ASL_LEVEL_WARNING; + break; + case RCTLogLevelError: + aslLevel = ASL_LEVEL_ERR; + break; + case RCTLogLevelMustFix: + aslLevel = ASL_LEVEL_EMERG; + break; + default: + aslLevel = ASL_LEVEL_DEBUG; + } + asl_log(NULL, NULL, aslLevel, "%s", message.UTF8String); }; void RCTSetLogFunction(RCTLogFunction logFunction)