mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 20:31:13 +08:00
Eliminate the explicit RKLogInitialize() method entirely in favor of the implicit RKLogInitializer class
This commit is contained in:
@@ -106,7 +106,6 @@ RKlcl_log(RKLogComponent, RKlcl_vTrace, @"" __VA_ARGS__)
|
||||
RKLogConfigureByName("RestKit/ObjectMapping", RKLogLevelCritical);
|
||||
*/
|
||||
#define RKLogConfigureByName(name, level) \
|
||||
RKLogInitialize(); \
|
||||
RKlcl_configure_by_name(name, level);
|
||||
|
||||
/**
|
||||
@@ -115,7 +114,6 @@ RKlcl_configure_by_name(name, level);
|
||||
their apps.
|
||||
*/
|
||||
#define RKLogSetAppLoggingLevel(level) \
|
||||
RKLogInitialize(); \
|
||||
RKlcl_configure_by_name("App", level);
|
||||
|
||||
/**
|
||||
@@ -178,11 +176,6 @@ RKlcl_configure_by_name("App", level);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
Initialize the logging environment
|
||||
*/
|
||||
void RKLogInitialize(void);
|
||||
|
||||
/**
|
||||
Configure RestKit logging from environment variables.
|
||||
(Use Option + Command + R to set Environment Variables prior to run.)
|
||||
|
||||
@@ -28,26 +28,15 @@
|
||||
|
||||
+ (void)load
|
||||
{
|
||||
RKLogInitialize();
|
||||
RKlcl_configure_by_name("RestKit*", RKLogLevelDefault);
|
||||
RKlcl_configure_by_name("App", RKLogLevelDefault);
|
||||
RKLogInfo(@"RestKit logging initialized...");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
int RKLogLevelForString(NSString *, NSString *);
|
||||
|
||||
static BOOL loggingInitialized = NO;
|
||||
|
||||
void RKLogInitialize(void)
|
||||
{
|
||||
if (loggingInitialized == NO) {
|
||||
RKlcl_configure_by_name("RestKit*", RKLogLevelDefault);
|
||||
RKlcl_configure_by_name("App", RKLogLevelDefault);
|
||||
RKLogInfo(@"RestKit initialized...");
|
||||
loggingInitialized = YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RKLogConfigureFromEnvironment(void)
|
||||
{
|
||||
static NSString *logComponentPrefix = @"RKLogLevel.";
|
||||
|
||||
Reference in New Issue
Block a user