summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLLoggingConfiguration_Private.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLLoggingConfiguration_Private.h')
-rw-r--r--platform/darwin/src/MGLLoggingConfiguration_Private.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLLoggingConfiguration_Private.h b/platform/darwin/src/MGLLoggingConfiguration_Private.h
new file mode 100644
index 0000000000..ff7e85eed8
--- /dev/null
+++ b/platform/darwin/src/MGLLoggingConfiguration_Private.h
@@ -0,0 +1,19 @@
+#import "MGLLoggingConfiguration.h"
+
+#define MGLLogInfo(message, ...) MGLLogWithType(MGLLoggingLevelInfo, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__)
+#define MGLLogDebug(message, ...) MGLLogWithType(MGLLoggingLevelDebug, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__)
+#define MGLLogError(message, ...) MGLLogWithType(MGLLoggingLevelError, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__)
+#define MGLLogFault(message, ...) MGLLogWithType(MGLLoggingLevelFault, __PRETTY_FUNCTION__, __LINE__, message, ##__VA_ARGS__)
+#define MGLLogWithType(type, function, line, message, ...) \
+{ \
+ if ([MGLLoggingConfiguration sharedConfiguration].loggingLevel != MGLLoggingLevelNone && type <= [MGLLoggingConfiguration sharedConfiguration].loggingLevel) \
+ { \
+ [[MGLLoggingConfiguration sharedConfiguration] logCallingFunction:function functionLine:line messageType:type format:(message), ##__VA_ARGS__]; \
+ } \
+}
+
+@interface MGLLoggingConfiguration (Private)
+
+- (void)logCallingFunction:(const char *)callingFunction functionLine:(NSUInteger)functionLine messageType:(MGLLoggingLevel)type format:(id)messageFormat, ...;
+
+@end