Permalink
Browse files

Rename logging enums :P (courtesy of @casademora to match 3adc1d8)

  • Loading branch information...
1 parent 1662d8d commit 09bf50706a5c10bfb63b295b650c6e01b75dc3f0 @casademora casademora committed with tonyarnold May 17, 2014
@@ -13,53 +13,54 @@
@since Available in v2.3 and later.
*/
-typedef NS_ENUM (NSInteger, MagicalRecordLogLevel)
+typedef NS_ENUM (NSInteger, MagicalRecordLoggingMask)
{
/** Disable all logging */
- MagicalRecordLogLevelOff = 0,
+ MagicalRecordLoggingMaskOff = 0,
/** Log fatal errors */
- MagicalRecordLogLevelFatal = 1 << 0,
+ MagicalRecordLoggingMaskFatal = 1 << 0,
/** Log all errors */
- MagicalRecordLogLevelError = 1 << 1,
+ MagicalRecordLoggingMaskError = 1 << 1,
/** Log warnings, and all errors */
- MagicalRecordLogLevelWarn = 1 << 2,
+ MagicalRecordLoggingMaskWarn = 1 << 2,
/** Log informative messagess, warnings and all errors */
- MagicalRecordLogLevelInfo = 1 << 3,
+ MagicalRecordLoggingMaskInfo = 1 << 3,
/** Log verbose diagnostic information, messages, warnings and all errors */
- MagicalRecordLogLevelVerbose = 1 << 4,
+ MagicalRecordLoggingMaskVerbose = 1 << 4,
};
/**
Defines a mask for logging that will be used by to filter log messages.
@since Available in v2.3 and later.
*/
-typedef NS_ENUM (NSInteger, MagicalRecordLoggingMask)
+typedef NS_ENUM (NSInteger, MagicalRecordLoggingLevel)
{
/** Don't log anything */
- MagicalRecordLogMaskOff = 0,
+ MagicalRecordLoggingLevelOff = 0,
/** Log all fatal messages */
- MagicalRecordLoggingMaskFatal = (MagicalRecordLogLevelFatal),
+ MagicalRecordLoggingLevelFatal = (MagicalRecordLoggingMaskFatal),
/** Log all errors and fatal messages */
- MagicalRecordLoggingMaskError = (MagicalRecordLogLevelFatal | MagicalRecordLogLevelError),
+ MagicalRecordLoggingLevelError = (MagicalRecordLoggingMaskFatal | MagicalRecordLoggingMaskError),
/** Log warnings, errors and fatal messages */
- MagicalRecordLoggingMaskWarn = (MagicalRecordLogLevelFatal | MagicalRecordLogLevelError | MagicalRecordLogLevelWarn),
+ MagicalRecordLoggingLevelWarn = (MagicalRecordLoggingMaskFatal | MagicalRecordLoggingMaskError | MagicalRecordLoggingMaskWarn),
/** Log informative, warning and error messages */
- MagicalRecordLoggingMaskInfo = (MagicalRecordLogLevelFatal | MagicalRecordLogLevelError | MagicalRecordLogLevelWarn | MagicalRecordLogLevelInfo),
+ MagicalRecordLoggingLevelInfo = (MagicalRecordLoggingMaskFatal | MagicalRecordLoggingMaskError | MagicalRecordLoggingMaskWarn | MagicalRecordLoggingMaskInfo),
/** Log verbose diagnostic, informative, warning and error messages */
- MagicalRecordLoggingMaskVerbose = (MagicalRecordLogLevelFatal | MagicalRecordLogLevelError | MagicalRecordLogLevelWarn | MagicalRecordLogLevelInfo | MagicalRecordLogLevelVerbose),
+ MagicalRecordLoggingLevelVerbose = (MagicalRecordLoggingMaskFatal | MagicalRecordLoggingMaskError | MagicalRecordLoggingMaskWarn | MagicalRecordLoggingMaskInfo | MagicalRecordLoggingMaskVerbose),
};
+
@interface MagicalRecord (Options)
/**
@@ -123,25 +124,25 @@ typedef NS_ENUM (NSInteger, MagicalRecordLoggingMask)
+ (void) setShouldDeleteStoreOnModelMismatch:(BOOL)shouldDelete;
/**
- @name Logging Mask
+ @name Logging Levels
*/
/**
Returns the logging mask set for MagicalRecord in the current application.
- @return Current MagicalRecordLogMask
-
+ @return Current MagicalRecordLoggingLevel
+
@since Available in v2.3 and later.
*/
-+ (MagicalRecordLoggingMask) loggingMask;
++ (MagicalRecordLoggingLevel) loggingLevel;
/**
Sets the logging mask set for MagicalRecord in the current application.
- @param mask Any value from MagicalRecordLogMask
+ @param level Any value from MagicalRecordLogLevel
@since Available in v2.3 and later.
*/
-+ (void) setLoggingMask:(MagicalRecordLoggingMask)mask;
++ (void) setLoggingLevel:(MagicalRecordLoggingLevel)level;
@end
@@ -8,7 +8,7 @@
#import "MagicalRecord+Options.h"
-static MagicalRecordLoggingMask kMagicalRecordLoggingMask = MagicalRecordLoggingMaskVerbose;
+static MagicalRecordLoggingLevel kMagicalRecordLoggingLevel = MagicalRecordLoggingLevelVerbose;
static BOOL kMagicalRecordShouldAutoCreateManagedObjectModel = NO;
static BOOL kMagicalRecordShouldAutoCreateDefaultPersistentStoreCoordinator = NO;
static BOOL kMagicalRecordShouldDeleteStoreOnModelMismatch = NO;
@@ -42,19 +42,19 @@ + (BOOL) shouldDeleteStoreOnModelMismatch;
return kMagicalRecordShouldDeleteStoreOnModelMismatch;
}
-+ (void) setShouldDeleteStoreOnModelMismatch:(BOOL)shouldDelete
++ (void) setShouldDeleteStoreOnModelMismatch:(BOOL)shouldDelete;
{
kMagicalRecordShouldDeleteStoreOnModelMismatch = shouldDelete;
}
-+ (MagicalRecordLoggingMask) loggingMask;
++ (MagicalRecordLoggingLevel) loggingLevel;
{
- return kMagicalRecordLoggingMask;
+ return kMagicalRecordLoggingLevel;
}
-+ (void) setLoggingMask:(MagicalRecordLoggingMask)mask;
++ (void) setLoggingLevel:(MagicalRecordLoggingLevel)level;
{
- kMagicalRecordLoggingMask = mask;
+ kMagicalRecordLoggingLevel = level;
}
@end
@@ -37,17 +37,17 @@
#endif
-#define MRLogFatal(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingMask], MagicalRecordLogLevelFatal, 0, frmt, ##__VA_ARGS__)
-#define MRLogError(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingMask], MagicalRecordLogLevelError, 0, frmt, ##__VA_ARGS__)
-#define MRLogWarn(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_WARN, [MagicalRecord loggingMask], MagicalRecordLogLevelWarn, 0, frmt, ##__VA_ARGS__)
-#define MRLogInfo(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_INFO, [MagicalRecord loggingMask], MagicalRecordLogLevelInfo, 0, frmt, ##__VA_ARGS__)
-#define MRLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, [MagicalRecord loggingMask], MagicalRecordLogLevelVerbose, 0, frmt, ##__VA_ARGS__)
-
-#define MRLogCFatal(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingMask], MagicalRecordLogLevelFatal, 0, frmt, ##__VA_ARGS__)
-#define MRLogCError(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingMask], MagicalRecordLogLevelError, 0, frmt, ##__VA_ARGS__)
-#define MRLogCWarn(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_WARN, [MagicalRecord loggingMask], MagicalRecordLogLevelWarn, 0, frmt, ##__VA_ARGS__)
-#define MRLogCInfo(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_INFO, [MagicalRecord loggingMask], MagicalRecordLogLevelInfo, 0, frmt, ##__VA_ARGS__)
-#define MRLogCVerbose(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_VERBOSE, [MagicalRecord loggingMask], MagicalRecordLogLevelVerbose, 0, frmt, ##__VA_ARGS__)
+#define MRLogFatal(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelFatal, 0, frmt, ##__VA_ARGS__)
+#define MRLogError(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelError, 0, frmt, ##__VA_ARGS__)
+#define MRLogWarn(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_WARN, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelWarn, 0, frmt, ##__VA_ARGS__)
+#define MRLogInfo(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_INFO, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelInfo, 0, frmt, ##__VA_ARGS__)
+#define MRLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelVerbose, 0, frmt, ##__VA_ARGS__)
+
+#define MRLogCFatal(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelFatal, 0, frmt, ##__VA_ARGS__)
+#define MRLogCError(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_ERROR, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelError, 0, frmt, ##__VA_ARGS__)
+#define MRLogCWarn(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_WARN, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelWarn, 0, frmt, ##__VA_ARGS__)
+#define MRLogCInfo(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_INFO, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelInfo, 0, frmt, ##__VA_ARGS__)
+#define MRLogCVerbose(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_VERBOSE, [MagicalRecord loggingLevel], MagicalRecordLoggingLevelVerbose, 0, frmt, ##__VA_ARGS__)
#else
@@ -13,7 +13,7 @@ - (void)setUp
[super setUp];
// Don't pollute the tests with logging
- [MagicalRecord setLoggingMask:MagicalRecordLoggingMaskInfo];
+ [MagicalRecord setLoggingLevel:MagicalRecordLoggingLevelVerbose];
// Setup the default model from the current class' bundle
[MagicalRecord setDefaultModelFromClass:[self class]];

0 comments on commit 09bf507

Please sign in to comment.