Actually define RCTSetLogThreshold()
Summary: This function was declared, but never defined, so calling it would crash your application. I also took this opportunity to ensure that the logging threshold is given a default value upon initialization, not just the first time `RCTGetLogThreshold()` is called. @public Reviewed By: @tadeuzagallo Differential Revision: D2475622
This commit is contained in:
parent
92109b8a0c
commit
0ff3a421c9
|
@ -32,21 +32,24 @@ const char *RCTLogLevels[] = {
|
|||
"mustfix"
|
||||
};
|
||||
|
||||
#if RCT_DEBUG
|
||||
static const RCTLogLevel RCTDefaultLogThreshold = RCTLogLevelInfo - 1;
|
||||
#else
|
||||
static const RCTLogLevel RCTDefaultLogThreshold = RCTLogLevelError;
|
||||
#endif
|
||||
|
||||
static RCTLogFunction RCTCurrentLogFunction;
|
||||
static RCTLogLevel RCTCurrentLogThreshold;
|
||||
static RCTLogLevel RCTCurrentLogThreshold = RCTDefaultLogThreshold;
|
||||
|
||||
RCTLogLevel RCTGetLogThreshold()
|
||||
{
|
||||
if (!RCTCurrentLogThreshold) {
|
||||
#if RCT_DEBUG
|
||||
RCTCurrentLogThreshold = RCTLogLevelInfo - 1;
|
||||
#else
|
||||
RCTCurrentLogThreshold = RCTLogLevelError;
|
||||
#endif
|
||||
}
|
||||
return RCTCurrentLogThreshold;
|
||||
}
|
||||
|
||||
void RCTSetLogThreshold(RCTLogLevel threshold) {
|
||||
RCTCurrentLogThreshold = threshold;
|
||||
}
|
||||
|
||||
RCTLogFunction RCTDefaultLogFunction = ^(
|
||||
RCTLogLevel level,
|
||||
NSString *fileName,
|
||||
|
|
Loading…
Reference in New Issue