This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
forked from maplibre/maplibre-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMLNLoggingConfiguration.h
99 lines (82 loc) · 2.59 KB
/
MLNLoggingConfiguration.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#import <Foundation/Foundation.h>
#import "MLNFoundation.h"
#ifndef MLN_LOGGING_DISABLED
#ifndef MLN_LOGGING_ENABLE_DEBUG
#ifndef NDEBUG
#define MLN_LOGGING_ENABLE_DEBUG 1
#endif
#endif
NS_ASSUME_NONNULL_BEGIN
/**
Constants indicating the message's logging level.
*/
typedef NS_ENUM(NSInteger, MLNLoggingLevel) {
/**
None-level won't print any messages.
*/
MLNLoggingLevelNone = 0,
/**
Fault-level messages contain system-level error information.
*/
MLNLoggingLevelFault,
/**
Error-level messages contain information that is intended to aid in process-level
errors.
*/
MLNLoggingLevelError,
/**
Warning-level messages contain warning information for potential risks.
*/
MLNLoggingLevelWarning,
/**
Info-level messages contain information that may be helpful for flow tracing
but is not essential.
*/
MLNLoggingLevelInfo,
/**
Debug-level messages contain information that may be helpful for troubleshooting
specific problems.
*/
#if MLN_LOGGING_ENABLE_DEBUG
MLNLoggingLevelDebug,
#endif
/**
Verbose-level will print all messages.
*/
MLNLoggingLevelVerbose,
};
/**
A block to be called once `loggingLevel` is set to a higher value than `MLNLoggingLevelNone`.
@param loggingLevel The message logging level.
@param filePath The description of the file and method for the calling message.
@param line The line where the message is logged.
@param message The logging message.
*/
typedef void (^MLNLoggingBlockHandler)(MLNLoggingLevel loggingLevel, NSString *filePath, NSUInteger line, NSString *message);
/**
The `MLNLoggingConfiguration` object provides a global way to set this SDK logging levels
and logging handler.
*/
MLN_EXPORT
@interface MLNLoggingConfiguration : NSObject
/**
The handler this SDK uses to log messages.
If this property is set to nil or if no custom handler is provided this property
is set to the default handler.
The default handler uses `os_log` and `NSLog` for iOS 10+ and iOS < 10 respectively.
*/
@property (nonatomic, copy, null_resettable) MLNLoggingBlockHandler handler;
/**
The logging level.
The default value is `MLNLoggingLevelNone`.
Setting this property includes logging levels less than or equal to the setted value.
*/
@property (assign, nonatomic) MLNLoggingLevel loggingLevel;
/**
Returns the shared logging object.
*/
@property (class, nonatomic, readonly) MLNLoggingConfiguration *sharedConfiguration;
- (MLNLoggingBlockHandler)handler UNAVAILABLE_ATTRIBUTE;
@end
NS_ASSUME_NONNULL_END
#endif