Eliminate the explicit RKLogInitialize() method entirely in favor of the implicit RKLogInitializer class

This commit is contained in:
Blake Watters
2012-11-06 12:56:28 -05:00
parent 0ea4b10d1c
commit 827945cfb3
2 changed files with 3 additions and 21 deletions

View File

@@ -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.)

View File

@@ -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.";