react-native-gizwits-sdk-v5 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/android/src/main/java/com/gizwits/reactnativegizwitssdkv5/RNGizSDKManagerModule.kt +18 -1
  2. package/android/src/main/java/com/gizwits/reactnativegizwitssdkv5/RNGizUserManagerModule.kt +5 -6
  3. package/package.json +1 -1
  4. package/react-native-gizwits-sdk-v5.podspec +3 -1
  5. package/ios/GizwitsiOSSDK.framework/GizwitsiOSSDK +0 -0
  6. package/ios/GizwitsiOSSDK.framework/Headers/CocoaAsyncSocket.h +0 -18
  7. package/ios/GizwitsiOSSDK.framework/Headers/DDASLLogger.h +0 -41
  8. package/ios/GizwitsiOSSDK.framework/Headers/DDAbstractDatabaseLogger.h +0 -102
  9. package/ios/GizwitsiOSSDK.framework/Headers/DDContextFilterLogFormatter.h +0 -63
  10. package/ios/GizwitsiOSSDK.framework/Headers/DDDispatchQueueLogFormatter.h +0 -128
  11. package/ios/GizwitsiOSSDK.framework/Headers/DDFileLogger.h +0 -340
  12. package/ios/GizwitsiOSSDK.framework/Headers/DDLog+LOGV.h +0 -99
  13. package/ios/GizwitsiOSSDK.framework/Headers/DDLog.h +0 -632
  14. package/ios/GizwitsiOSSDK.framework/Headers/DDMultiFormatter.h +0 -30
  15. package/ios/GizwitsiOSSDK.framework/Headers/DDTTYLogger.h +0 -171
  16. package/ios/GizwitsiOSSDK.framework/Headers/ForegroundReconnection.h +0 -23
  17. package/ios/GizwitsiOSSDK.framework/Headers/GCDTimer.h +0 -19
  18. package/ios/GizwitsiOSSDK.framework/Headers/GizwitsiOSSDK-Swift.h +0 -313
  19. package/ios/GizwitsiOSSDK.framework/Headers/GizwitsiOSSDK.h +0 -21
  20. package/ios/GizwitsiOSSDK.framework/Headers/MQTTClient.h +0 -39
  21. package/ios/GizwitsiOSSDK.framework/Headers/MQTTInMemoryPersistence.h +0 -16
  22. package/ios/GizwitsiOSSDK.framework/Headers/MQTTSSLSecurityPolicyDecoder.h +0 -19
  23. package/ios/GizwitsiOSSDK.framework/Headers/MQTTSSLSecurityPolicyEncoder.h +0 -18
  24. package/ios/GizwitsiOSSDK.framework/Headers/MQTTSessionLegacy.h +0 -112
  25. package/ios/GizwitsiOSSDK.framework/Headers/MQTTSessionSynchron.h +0 -194
  26. package/ios/GizwitsiOSSDK.framework/Headers/MQTTStrict.h +0 -33
  27. package/ios/GizwitsiOSSDK.framework/Headers/MQTTUntil.h +0 -14
  28. package/ios/GizwitsiOSSDK.framework/Headers/ReconnectTimer.h +0 -21
  29. package/ios/GizwitsiOSSDK.framework/Headers/_GCDAsyncSocket.h +0 -1226
  30. package/ios/GizwitsiOSSDK.framework/Headers/_GCDAsyncUdpSocket.h +0 -1036
  31. package/ios/GizwitsiOSSDK.framework/Headers/_GizwitsParser.h +0 -61
  32. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCFSocketDecoder.h +0 -39
  33. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCFSocketEncoder.h +0 -38
  34. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCFSocketTransport.h +0 -79
  35. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCoreDataPersistence.h +0 -21
  36. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTDecoder.h +0 -66
  37. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTLog.h +0 -123
  38. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTMessage.h +0 -233
  39. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTPersistence.h +0 -124
  40. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTProperties.h +0 -76
  41. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSSLSecurityPolicy.h +0 -158
  42. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSSLSecurityPolicyTransport.h +0 -30
  43. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSession.h +0 -886
  44. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSessionManager.h +0 -237
  45. package/ios/GizwitsiOSSDK.framework/Headers/_MQTTTransport.h +0 -114
  46. package/ios/GizwitsiOSSDK.framework/Headers/common.h +0 -104
  47. package/ios/GizwitsiOSSDK.framework/Info.plist +0 -0
  48. package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  49. package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.abi.json +0 -9
  50. package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  51. package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
  52. package/ios/GizwitsiOSSDK.framework/Modules/module.modulemap +0 -11
@@ -17,7 +17,6 @@ import com.gizwits.smart.sdk.bluetooth.startBleScan
17
17
  import com.gizwits.smart.sdk.bluetooth.stopBleScan
18
18
  import com.gizwits.smart.sdk.bluetooth.subscribeBluetoothDeviceList
19
19
  import com.gizwits.smart.sdk.common.GizConfiguration
20
- import com.gizwits.smart.sdk.common.combineLatest
21
20
  import com.gizwits.smart.sdk.exception.GizException
22
21
  import com.gizwits.smart.sdk.lan.lanCapacity
23
22
  import com.gizwits.smart.sdk.lan.subscribeLanDeviceList
@@ -27,13 +26,16 @@ import com.gizwits.smart.sdk.mqtt.subscribeBoundDeviceList
27
26
  import com.google.gson.annotations.SerializedName
28
27
  import kotlinx.coroutines.CoroutineScope
29
28
  import kotlinx.coroutines.Dispatchers
29
+ import kotlinx.coroutines.ExperimentalCoroutinesApi
30
30
  import kotlinx.coroutines.flow.Flow
31
31
  import kotlinx.coroutines.flow.collect
32
32
  import kotlinx.coroutines.flow.collectLatest
33
+ import kotlinx.coroutines.flow.combine
33
34
  import kotlinx.coroutines.flow.debounce
34
35
  import kotlinx.coroutines.flow.drop
35
36
  import kotlinx.coroutines.flow.first
36
37
  import kotlinx.coroutines.flow.last
38
+ import kotlinx.coroutines.flow.mapLatest
37
39
  import kotlinx.coroutines.flow.take
38
40
  import kotlinx.coroutines.flow.toList
39
41
  import kotlinx.coroutines.launch
@@ -57,6 +59,21 @@ class RNGizSDKManagerModule(reactContext: ReactApplicationContext) : ReactContex
57
59
  DeviceStateListener("DeviceStateListener")
58
60
  }
59
61
 
62
+ /** @hide */
63
+ @OptIn(ExperimentalCoroutinesApi::class)
64
+ fun <T1, T2, T3, R> combineLatest(
65
+ flow1: Flow<T1>,
66
+ flow2: Flow<T2>,
67
+ flow3: Flow<T3>,
68
+ transform: suspend (a: T1, b: T2, c: T3) -> R
69
+ ): Flow<R> {
70
+ return combine(flow1, flow2, flow3) { value1, value2, value3 ->
71
+ Triple(value1, value2, value3)
72
+ }.mapLatest {
73
+ transform(it.first, it.second, it.third)
74
+ }
75
+ }
76
+
60
77
  override fun getName() = "RNGizSDKManagerModule"
61
78
  private val deviceListState: Flow<List<GizDevice>> =
62
79
  combineLatest(
@@ -5,8 +5,7 @@ import com.facebook.react.bridge.ReactApplicationContext
5
5
  import com.facebook.react.bridge.ReactContextBaseJavaModule
6
6
  import com.facebook.react.bridge.ReactMethod
7
7
  import com.facebook.react.bridge.ReadableMap
8
- import com.gizwits.smart.sdk.GizUserManagerImpl
9
- import com.gizwits.smart.sdk.common.GizConfiguration
8
+ import com.gizwits.smart.sdk.GizSDKManager
10
9
  import com.gizwits.smart.sdk.core.data.model.UserToken
11
10
  import com.google.gson.annotations.SerializedName
12
11
  import kotlinx.coroutines.CoroutineScope
@@ -26,7 +25,7 @@ class RNGizUserManagerModule(reactContext: ReactApplicationContext) : ReactConte
26
25
 
27
26
  @ReactMethod
28
27
  fun getAuthorizeData(options: ReadableMap, result: Callback) {
29
- val tokenInfo = GizUserManagerImpl.getUserTokenStream().value
28
+ val tokenInfo = GizSDKManager.getUserManager().getUserTokenStream().value
30
29
  val authData = UpdateAuthorizeDataParams(tokenInfo?.token ?: "", tokenInfo?.userId ?: "")
31
30
  GizRNCallbackManager.callbackWithResult(callback = result, result = Result.success(authData))
32
31
  }
@@ -35,7 +34,7 @@ class RNGizUserManagerModule(reactContext: ReactApplicationContext) : ReactConte
35
34
  var config = RNGizParamsChecker.check(options, result, UpdateAuthorizeDataParams::class.java)
36
35
  config?.let {
37
36
  // Date 暂时没有用到
38
- GizUserManagerImpl.updateAuthorizeData(UserToken(config.token, config.uid, Date()))
37
+ GizSDKManager.getUserManager().updateAuthorizeData(UserToken(config.token, config.uid, Date()))
39
38
  GizRNCallbackManager.callbackWithResult(callback = result, result = Result.success(0))
40
39
  }
41
40
 
@@ -43,14 +42,14 @@ class RNGizUserManagerModule(reactContext: ReactApplicationContext) : ReactConte
43
42
  @ReactMethod
44
43
  fun loginByAnonymous(options: ReadableMap, result: Callback) {
45
44
  CoroutineScope(Dispatchers.Main).launch {
46
- val res = GizUserManagerImpl.loginByAnonymous()
45
+ val res = GizSDKManager.getUserManager().loginByAnonymous()
47
46
  GizRNCallbackManager.callbackWithResult(callback = result, result = res)
48
47
  }
49
48
  }
50
49
  @ReactMethod
51
50
  fun logout(options: ReadableMap, result: Callback) {
52
51
  CoroutineScope(Dispatchers.Main).launch {
53
- val res = GizUserManagerImpl.logout()
52
+ val res = GizSDKManager.getUserManager().logout()
54
53
  GizRNCallbackManager.callbackWithResult(callback = result, result = res)
55
54
  }
56
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gizwits-sdk-v5",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Gizwits",
5
5
  "homepage": "https://github.com/demchenkoalex/react-native-gizwits-sdk-v5#readme",
6
6
  "main": "lib/index.js",
@@ -14,10 +14,12 @@ Pod::Spec.new do |s|
14
14
 
15
15
  s.source = { :git => "https://github.com/demchenkoalex/react-native-module-template.git", :tag => "v#{s.version}" }
16
16
  s.source_files = "ios/**/*.{h,m,swift}"
17
- s.vendored_frameworks = "ios/GizwitsiOSSDK.framework"
17
+ # s.vendored_frameworks = "ios/GizwitsiOSSDK.framework"
18
18
  s.requires_arc = true
19
19
 
20
20
  s.dependency 'React'
21
21
  s.dependency 'Sentry', '~> 8.0'
22
22
  s.dependency 'CryptoSwift', '~> 1.8.0'
23
+ s.dependency 'GizwitsiOSSDK', '~> 1.0.0'
24
+
23
25
  end
@@ -1,18 +0,0 @@
1
- //
2
- // CocoaAsyncSocket.h
3
- // CocoaAsyncSocket
4
- //
5
- // Created by Derek Clarkson on 10/08/2015.
6
- // CocoaAsyncSocket project is in the public domain.
7
- //
8
-
9
- #import <Foundation/Foundation.h>
10
-
11
- //! Project version number for CocoaAsyncSocket.
12
- FOUNDATION_EXPORT double _cocoaAsyncSocketVersionNumber;
13
-
14
- //! Project version string for CocoaAsyncSocket.
15
- FOUNDATION_EXPORT const unsigned char _cocoaAsyncSocketVersionString[];
16
-
17
- #import "_GCDAsyncSocket.h"
18
- #import "_GCDAsyncUdpSocket.h"
@@ -1,41 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import <asl.h>
3
-
4
- #import "DDLog.h"
5
-
6
- /**
7
- * Welcome to Cocoa Lumberjack!
8
- *
9
- * The project page has a wealth of documentation if you have any questions.
10
- * https://github.com/CocoaLumberjack/CocoaLumberjack
11
- *
12
- * If you're new to the project you may wish to read the "Getting Started" wiki.
13
- * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
14
- *
15
- *
16
- * This class provides a logger for the Apple System Log facility.
17
- *
18
- * As described in the "Getting Started" page,
19
- * the traditional NSLog() function directs it's output to two places:
20
- *
21
- * - Apple System Log
22
- * - StdErr (if stderr is a TTY) so log statements show up in Xcode console
23
- *
24
- * To duplicate NSLog() functionality you can simply add this logger and a tty logger.
25
- * However, if you instead choose to use file logging (for faster performance),
26
- * you may choose to use a file logger and a tty logger.
27
- **/
28
-
29
- @interface DDASLLogger : DDAbstractLogger <DDLogger>
30
- {
31
- aslclient client;
32
- }
33
-
34
- + (instancetype)sharedInstance;
35
-
36
- // Inherited from DDAbstractLogger
37
-
38
- // - (id <DDLogFormatter>)logFormatter;
39
- // - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
40
-
41
- @end
@@ -1,102 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- #import "DDLog.h"
4
-
5
- /**
6
- * Welcome to Cocoa Lumberjack!
7
- *
8
- * The project page has a wealth of documentation if you have any questions.
9
- * https://github.com/CocoaLumberjack/CocoaLumberjack
10
- *
11
- * If you're new to the project you may wish to read the "Getting Started" wiki.
12
- * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
13
- *
14
- *
15
- * This class provides an abstract implementation of a database logger.
16
- *
17
- * That is, it provides the base implementation for a database logger to build atop of.
18
- * All that is needed for a concrete database logger is to extend this class
19
- * and override the methods in the implementation file that are prefixed with "db_".
20
- **/
21
-
22
- @interface DDAbstractDatabaseLogger : DDAbstractLogger {
23
- @protected
24
- NSUInteger saveThreshold;
25
- NSTimeInterval saveInterval;
26
- NSTimeInterval maxAge;
27
- NSTimeInterval deleteInterval;
28
- BOOL deleteOnEverySave;
29
-
30
- BOOL saveTimerSuspended;
31
- NSUInteger unsavedCount;
32
- dispatch_time_t unsavedTime;
33
- dispatch_source_t saveTimer;
34
- dispatch_time_t lastDeleteTime;
35
- dispatch_source_t deleteTimer;
36
- }
37
-
38
- /**
39
- * Specifies how often to save the data to disk.
40
- * Since saving is an expensive operation (disk io) it is not done after every log statement.
41
- * These properties allow you to configure how/when the logger saves to disk.
42
- *
43
- * A save is done when either (whichever happens first):
44
- *
45
- * - The number of unsaved log entries reaches saveThreshold
46
- * - The amount of time since the oldest unsaved log entry was created reaches saveInterval
47
- *
48
- * You can optionally disable the saveThreshold by setting it to zero.
49
- * If you disable the saveThreshold you are entirely dependent on the saveInterval.
50
- *
51
- * You can optionally disable the saveInterval by setting it to zero (or a negative value).
52
- * If you disable the saveInterval you are entirely dependent on the saveThreshold.
53
- *
54
- * It's not wise to disable both saveThreshold and saveInterval.
55
- *
56
- * The default saveThreshold is 500.
57
- * The default saveInterval is 60 seconds.
58
- **/
59
- @property (assign, readwrite) NSUInteger saveThreshold;
60
- @property (assign, readwrite) NSTimeInterval saveInterval;
61
-
62
- /**
63
- * It is likely you don't want the log entries to persist forever.
64
- * Doing so would allow the database to grow infinitely large over time.
65
- *
66
- * The maxAge property provides a way to specify how old a log statement can get
67
- * before it should get deleted from the database.
68
- *
69
- * The deleteInterval specifies how often to sweep for old log entries.
70
- * Since deleting is an expensive operation (disk io) is is done on a fixed interval.
71
- *
72
- * An alternative to the deleteInterval is the deleteOnEverySave option.
73
- * This specifies that old log entries should be deleted during every save operation.
74
- *
75
- * You can optionally disable the maxAge by setting it to zero (or a negative value).
76
- * If you disable the maxAge then old log statements are not deleted.
77
- *
78
- * You can optionally disable the deleteInterval by setting it to zero (or a negative value).
79
- *
80
- * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted.
81
- *
82
- * It's not wise to enable both deleteInterval and deleteOnEverySave.
83
- *
84
- * The default maxAge is 7 days.
85
- * The default deleteInterval is 5 minutes.
86
- * The default deleteOnEverySave is NO.
87
- **/
88
- @property (assign, readwrite) NSTimeInterval maxAge;
89
- @property (assign, readwrite) NSTimeInterval deleteInterval;
90
- @property (assign, readwrite) BOOL deleteOnEverySave;
91
-
92
- /**
93
- * Forces a save of any pending log entries (flushes log entries to disk).
94
- **/
95
- - (void)savePendingLogEntries;
96
-
97
- /**
98
- * Removes any log entries that are older than maxAge.
99
- **/
100
- - (void)deleteOldLogEntries;
101
-
102
- @end
@@ -1,63 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "DDLog.h"
3
-
4
- /**
5
- * Welcome to Cocoa Lumberjack!
6
- *
7
- * The project page has a wealth of documentation if you have any questions.
8
- * https://github.com/CocoaLumberjack/CocoaLumberjack
9
- *
10
- * If you're new to the project you may wish to read the "Getting Started" page.
11
- * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
12
- *
13
- *
14
- * This class provides a log formatter that filters log statements from a logging context not on the whitelist.
15
- *
16
- * A log formatter can be added to any logger to format and/or filter its output.
17
- * You can learn more about log formatters here:
18
- * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
19
- *
20
- * You can learn more about logging context's here:
21
- * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomContext
22
- *
23
- * But here's a quick overview / refresher:
24
- *
25
- * Every log statement has a logging context.
26
- * These come from the underlying logging macros defined in DDLog.h.
27
- * The default logging context is zero.
28
- * You can define multiple logging context's for use in your application.
29
- * For example, logically separate parts of your app each have a different logging context.
30
- * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context.
31
- **/
32
- @interface DDContextWhitelistFilterLogFormatter : NSObject <DDLogFormatter>
33
-
34
- - (id)init;
35
-
36
- - (void)addToWhitelist:(int)loggingContext;
37
- - (void)removeFromWhitelist:(int)loggingContext;
38
-
39
- - (NSArray *)whitelist;
40
-
41
- - (BOOL)isOnWhitelist:(int)loggingContext;
42
-
43
- @end
44
-
45
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
46
- #pragma mark -
47
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
48
-
49
- /**
50
- * This class provides a log formatter that filters log statements from a logging context on the blacklist.
51
- **/
52
- @interface DDContextBlacklistFilterLogFormatter : NSObject <DDLogFormatter>
53
-
54
- - (id)init;
55
-
56
- - (void)addToBlacklist:(int)loggingContext;
57
- - (void)removeFromBlacklist:(int)loggingContext;
58
-
59
- - (NSArray *)blacklist;
60
-
61
- - (BOOL)isOnBlacklist:(int)loggingContext;
62
-
63
- @end
@@ -1,128 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import <libkern/OSAtomic.h>
3
- #import "DDLog.h"
4
-
5
-
6
- /**
7
- * Welcome to Cocoa Lumberjack!
8
- *
9
- * The project page has a wealth of documentation if you have any questions.
10
- * https://github.com/CocoaLumberjack/CocoaLumberjack
11
- *
12
- * If you're new to the project you may wish to read the "Getting Started" page.
13
- * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
14
- *
15
- *
16
- * This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id.
17
- *
18
- * A log formatter can be added to any logger to format and/or filter its output.
19
- * You can learn more about log formatters here:
20
- * https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
21
- *
22
- * A typical NSLog (or DDTTYLogger) prints detailed info as [<process_id>:<thread_id>].
23
- * For example:
24
- *
25
- * 2011-10-17 20:21:45.435 AppName[19928:5207] Your log message here
26
- *
27
- * Where:
28
- * - 19928 = process id
29
- * - 5207 = thread id (mach_thread_id printed in hex)
30
- *
31
- * When using grand central dispatch (GCD), this information is less useful.
32
- * This is because a single serial dispatch queue may be run on any thread from an internally managed thread pool.
33
- * For example:
34
- *
35
- * 2011-10-17 20:32:31.111 AppName[19954:4d07] Message from my_serial_dispatch_queue
36
- * 2011-10-17 20:32:31.112 AppName[19954:5207] Message from my_serial_dispatch_queue
37
- * 2011-10-17 20:32:31.113 AppName[19954:2c55] Message from my_serial_dispatch_queue
38
- *
39
- * This formatter allows you to replace the standard [box:info] with the dispatch_queue name.
40
- * For example:
41
- *
42
- * 2011-10-17 20:32:31.111 AppName[img-scaling] Message from my_serial_dispatch_queue
43
- * 2011-10-17 20:32:31.112 AppName[img-scaling] Message from my_serial_dispatch_queue
44
- * 2011-10-17 20:32:31.113 AppName[img-scaling] Message from my_serial_dispatch_queue
45
- *
46
- * If the dispatch_queue doesn't have a set name, then it falls back to the thread name.
47
- * If the current thread doesn't have a set name, then it falls back to the mach_thread_id in hex (like normal).
48
- *
49
- * Note: If manually creating your own background threads (via NSThread/alloc/init or NSThread/detachNeThread),
50
- * you can use [[NSThread currentThread] setName:(NSString *)].
51
- **/
52
- @interface DDDispatchQueueLogFormatter : NSObject <DDLogFormatter> {
53
- @protected
54
-
55
- NSString *dateFormatString;
56
- }
57
-
58
- /**
59
- * Standard init method.
60
- * Configure using properties as desired.
61
- **/
62
- - (id)init;
63
-
64
- /**
65
- * The minQueueLength restricts the minimum size of the [detail box].
66
- * If the minQueueLength is set to 0, there is no restriction.
67
- *
68
- * For example, say a dispatch_queue has a label of "diskIO":
69
- *
70
- * If the minQueueLength is 0: [diskIO]
71
- * If the minQueueLength is 4: [diskIO]
72
- * If the minQueueLength is 5: [diskIO]
73
- * If the minQueueLength is 6: [diskIO]
74
- * If the minQueueLength is 7: [diskIO ]
75
- * If the minQueueLength is 8: [diskIO ]
76
- *
77
- * The default minQueueLength is 0 (no minimum, so [detail box] won't be padded).
78
- *
79
- * If you want every [detail box] to have the exact same width,
80
- * set both minQueueLength and maxQueueLength to the same value.
81
- **/
82
- @property (assign) NSUInteger minQueueLength;
83
-
84
- /**
85
- * The maxQueueLength restricts the number of characters that will be inside the [detail box].
86
- * If the maxQueueLength is 0, there is no restriction.
87
- *
88
- * For example, say a dispatch_queue has a label of "diskIO":
89
- *
90
- * If the maxQueueLength is 0: [diskIO]
91
- * If the maxQueueLength is 4: [disk]
92
- * If the maxQueueLength is 5: [diskI]
93
- * If the maxQueueLength is 6: [diskIO]
94
- * If the maxQueueLength is 7: [diskIO]
95
- * If the maxQueueLength is 8: [diskIO]
96
- *
97
- * The default maxQueueLength is 0 (no maximum, so [detail box] won't be truncated).
98
- *
99
- * If you want every [detail box] to have the exact same width,
100
- * set both minQueueLength and maxQueueLength to the same value.
101
- **/
102
- @property (assign) NSUInteger maxQueueLength;
103
-
104
- /**
105
- * Sometimes queue labels have long names like "com.apple.main-queue",
106
- * but you'd prefer something shorter like simply "main".
107
- *
108
- * This method allows you to set such preferred replacements.
109
- * The above example is set by default.
110
- *
111
- * To remove/undo a previous replacement, invoke this method with nil for the 'shortLabel' parameter.
112
- **/
113
- - (NSString *)replacementStringForQueueLabel:(NSString *)longLabel;
114
- - (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel;
115
-
116
- @end
117
-
118
- /**
119
- * Method declarations that make it easier to extend/modify DDDispatchQueueLogFormatter
120
- **/
121
- @interface DDDispatchQueueLogFormatter (OverridableMethods)
122
-
123
- - (NSString *)stringFromDate:(NSDate *)date;
124
- - (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage;
125
- - (NSString *)formatLogMessage:(DDLogMessage *)logMessage;
126
-
127
- @end
128
-