@datadog/mobile-react-native 1.7.1 → 1.8.0-rc0
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.
- package/DatadogSDKReactNative.podspec +14 -1
- package/android/build.gradle +20 -7
- package/android/src/main/kotlin/com/datadog/reactnative/{DdLogs.kt → DdLogsImplementation.kt} +3 -17
- package/android/src/main/kotlin/com/datadog/reactnative/{DdRum.kt → DdRumImplementation.kt} +2 -18
- package/android/src/main/kotlin/com/datadog/reactnative/{DdSdk.kt → DdSdkImplementation.kt} +3 -14
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkReactNativePackage.kt +34 -17
- package/android/src/main/kotlin/com/datadog/reactnative/{DdTrace.kt → DdTraceImplementation.kt} +6 -11
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdLogs.kt +148 -0
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdRum.kt +199 -0
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdSdk.kt +90 -0
- package/android/src/newarch/kotlin/com/datadog/reactnative/DdTrace.kt +46 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdLogs.kt +163 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdRum.kt +200 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdSdk.kt +91 -0
- package/android/src/oldarch/kotlin/com/datadog/reactnative/DdTrace.kt +47 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdLogsTest.kt +3 -13
- package/android/src/test/kotlin/com/datadog/reactnative/DdRumTest.kt +2 -6
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +33 -33
- package/android/src/test/kotlin/com/datadog/reactnative/DdTraceTest.kt +2 -6
- package/ios/Sources/{DdSdkReactNative-Bridging-Header.h → DatadogSDKReactNative.h} +2 -1
- package/ios/Sources/DdLogs.h +24 -0
- package/ios/Sources/DdLogs.mm +149 -0
- package/ios/Sources/{DdLogs.swift → DdLogsImplementation.swift} +20 -29
- package/ios/Sources/DdRum.h +24 -0
- package/ios/Sources/DdRum.mm +188 -0
- package/ios/Sources/{DdRum.swift → DdRumImplementation.swift} +28 -35
- package/ios/Sources/DdSdk.h +24 -0
- package/ios/Sources/DdSdk.mm +119 -0
- package/ios/Sources/{DdSdk.swift → DdSdkImplementation.swift} +20 -25
- package/ios/Sources/DdTrace.h +24 -0
- package/ios/Sources/DdTrace.mm +66 -0
- package/ios/Sources/{DdTrace.swift → DdTraceImplementation.swift} +10 -17
- package/ios/Sources/QueueHolder.swift +8 -0
- package/jest/mock.js +3 -1
- package/lib/commonjs/DdSdkReactNative.js +32 -49
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/DdSdkReactNativeConfiguration.js +18 -0
- package/lib/commonjs/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/commonjs/logs/DdLogs.js +33 -40
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/nativeModulesTypes.js +13 -0
- package/lib/commonjs/nativeModulesTypes.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +104 -106
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/eventMappers/errorEventMapper.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +11 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +6 -2
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/commonjs/sdk/DdSdk.js +3 -3
- package/lib/commonjs/sdk/DdSdk.js.map +1 -1
- package/lib/commonjs/specs/NativeDdLogs.js +20 -0
- package/lib/commonjs/specs/NativeDdLogs.js.map +1 -0
- package/lib/commonjs/specs/NativeDdRum.js +20 -0
- package/lib/commonjs/specs/NativeDdRum.js.map +1 -0
- package/lib/commonjs/specs/NativeDdSdk.js +20 -0
- package/lib/commonjs/specs/NativeDdSdk.js.map +1 -0
- package/lib/commonjs/specs/NativeDdTrace.js +20 -0
- package/lib/commonjs/specs/NativeDdTrace.js.map +1 -0
- package/lib/commonjs/trace/DdTrace.js +10 -12
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/DdSdkReactNative.js +27 -44
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/DdSdkReactNativeConfiguration.js +18 -0
- package/lib/module/DdSdkReactNativeConfiguration.js.map +1 -1
- package/lib/module/logs/DdLogs.js +33 -39
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/nativeModulesTypes.js +13 -0
- package/lib/module/nativeModulesTypes.js.map +1 -1
- package/lib/module/rum/DdRum.js +100 -101
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/eventMappers/errorEventMapper.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js +11 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdEventsInterceptor.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js +6 -2
- package/lib/module/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.js.map +1 -1
- package/lib/module/sdk/DdSdk.js +3 -2
- package/lib/module/sdk/DdSdk.js.map +1 -1
- package/lib/module/specs/NativeDdLogs.js +14 -0
- package/lib/module/specs/NativeDdLogs.js.map +1 -0
- package/lib/module/specs/NativeDdRum.js +14 -0
- package/lib/module/specs/NativeDdRum.js.map +1 -0
- package/lib/module/specs/NativeDdSdk.js +14 -0
- package/lib/module/specs/NativeDdSdk.js.map +1 -0
- package/lib/module/specs/NativeDdTrace.js +14 -0
- package/lib/module/specs/NativeDdTrace.js.map +1 -0
- package/lib/module/trace/DdTrace.js +10 -11
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/DdSdkReactNative.d.ts +4 -4
- package/lib/typescript/DdSdkReactNativeConfiguration.d.ts +14 -0
- package/lib/typescript/logs/DdLogs.d.ts +4 -4
- package/lib/typescript/nativeModulesTypes.d.ts +28 -168
- package/lib/typescript/rum/DdRum.d.ts +12 -12
- package/lib/typescript/rum/eventMappers/errorEventMapper.d.ts +4 -4
- package/lib/typescript/rum/instrumentation/interactionTracking/DdEventsInterceptor.d.ts +4 -0
- package/lib/typescript/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.d.ts +3 -1
- package/lib/typescript/specs/NativeDdLogs.d.ts +69 -0
- package/lib/typescript/specs/NativeDdRum.d.ts +92 -0
- package/lib/typescript/specs/NativeDdSdk.d.ts +46 -0
- package/lib/typescript/specs/NativeDdTrace.d.ts +23 -0
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +10 -2
- package/src/DdSdkReactNative.tsx +12 -10
- package/src/DdSdkReactNativeConfiguration.tsx +22 -0
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +3 -1
- package/src/__tests__/longTasksUtils.test.ts +5 -0
- package/src/__tests__/mock.test.ts +89 -0
- package/src/__tests__/rum/instrumentation/DdEventsInterceptor.test.tsx +54 -0
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +118 -68
- package/src/logs/DdLogs.ts +11 -11
- package/src/logs/__tests__/DdLogs.test.ts +1 -1
- package/src/nativeModulesTypes.ts +49 -254
- package/src/rum/DdRum.ts +36 -32
- package/src/rum/eventMappers/errorEventMapper.ts +4 -4
- package/src/rum/instrumentation/interactionTracking/DdEventsInterceptor.tsx +15 -0
- package/src/rum/instrumentation/interactionTracking/DdRumUserInteractionTracking.tsx +6 -2
- package/src/sdk/DdSdk.ts +2 -3
- package/src/specs/NativeDdLogs.ts +110 -0
- package/src/specs/NativeDdRum.ts +151 -0
- package/src/specs/NativeDdSdk.ts +62 -0
- package/src/specs/NativeDdTrace.ts +42 -0
- package/src/trace/DdTrace.ts +9 -9
- package/src/version.ts +1 -1
- package/ios/Sources/DdLogs.m +0 -62
- package/ios/Sources/DdRum.m +0 -82
- package/ios/Sources/DdSdk.m +0 -41
- package/ios/Sources/DdTrace.m +0 -23
|
@@ -13,12 +13,14 @@ import {
|
|
|
13
13
|
TouchableHighlight,
|
|
14
14
|
TouchableNativeFeedback,
|
|
15
15
|
TouchableWithoutFeedback,
|
|
16
|
-
StyleSheet
|
|
16
|
+
StyleSheet,
|
|
17
|
+
NativeModules
|
|
17
18
|
} from 'react-native';
|
|
18
19
|
import React from 'react';
|
|
19
20
|
|
|
20
|
-
import {
|
|
21
|
+
import type { DdNativeRumType } from '../../../nativeModulesTypes';
|
|
21
22
|
import { DdRumUserInteractionTracking } from '../../../rum/instrumentation/interactionTracking/DdRumUserInteractionTracking';
|
|
23
|
+
import { BufferSingleton } from '../../../sdk/DatadogProvider/Buffer/BufferSingleton';
|
|
22
24
|
import { DdSdk } from '../../../sdk/DdSdk';
|
|
23
25
|
|
|
24
26
|
const styles = StyleSheet.create({
|
|
@@ -29,9 +31,7 @@ const styles = StyleSheet.create({
|
|
|
29
31
|
}
|
|
30
32
|
});
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
'../../../rum/instrumentation/interactionTracking/DdEventsInterceptor'
|
|
34
|
-
);
|
|
34
|
+
const DdRum = NativeModules.DdRum as DdNativeRumType;
|
|
35
35
|
|
|
36
36
|
// Silence the warning https://github.com/facebook/react-native/issues/11094#issuecomment-263240420
|
|
37
37
|
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
|
|
@@ -39,6 +39,7 @@ jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
|
|
|
39
39
|
beforeEach(() => {
|
|
40
40
|
jest.setTimeout(20000);
|
|
41
41
|
jest.clearAllMocks();
|
|
42
|
+
BufferSingleton.onInitialization();
|
|
42
43
|
});
|
|
43
44
|
|
|
44
45
|
afterEach(() => {
|
|
@@ -53,26 +54,58 @@ it('M intercept and send a RUM event W onPress { Button component }', async () =
|
|
|
53
54
|
DdRumUserInteractionTracking.startTracking();
|
|
54
55
|
const { getByText } = render(
|
|
55
56
|
<View>
|
|
56
|
-
<Button
|
|
57
|
-
title="Click me"
|
|
58
|
-
accessibilityLabel="click_me_button"
|
|
59
|
-
onPress={event => {}}
|
|
60
|
-
/>
|
|
57
|
+
<Button title="Click me" onPress={event => {}} />
|
|
61
58
|
</View>
|
|
62
59
|
);
|
|
63
60
|
const testButton = getByText('Click me');
|
|
64
61
|
|
|
65
62
|
// WHEN
|
|
66
|
-
fireEvent(testButton, 'press'
|
|
63
|
+
fireEvent(testButton, 'press', {
|
|
64
|
+
_targetInst: {
|
|
65
|
+
memoizedProps: {
|
|
66
|
+
accessibilityLabel: 'click_me_button'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
67
70
|
|
|
68
71
|
// THEN
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
expect(DdRum.addAction).toBeCalledWith(
|
|
73
|
+
'TAP',
|
|
74
|
+
'click_me_button',
|
|
75
|
+
expect.anything(),
|
|
76
|
+
expect.anything()
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('M intercept and send a RUM event W onPress { custom action name prop used }', async () => {
|
|
81
|
+
// GIVEN
|
|
82
|
+
DdRumUserInteractionTracking.startTracking({
|
|
83
|
+
actionNameAttribute: 'testID'
|
|
84
|
+
});
|
|
85
|
+
const { getByText } = render(
|
|
86
|
+
<View>
|
|
87
|
+
<Button title="Click me" onPress={event => {}} />
|
|
88
|
+
</View>
|
|
89
|
+
);
|
|
90
|
+
const testButton = getByText('Click me');
|
|
91
|
+
|
|
92
|
+
// WHEN
|
|
93
|
+
fireEvent(testButton, 'press', {
|
|
94
|
+
_targetInst: {
|
|
95
|
+
memoizedProps: {
|
|
96
|
+
accessibilityLabel: 'click_me_button',
|
|
97
|
+
testID: 'click_me_test_ID'
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// THEN
|
|
103
|
+
expect(DdRum.addAction).toBeCalledWith(
|
|
104
|
+
'TAP',
|
|
105
|
+
'click_me_test_ID',
|
|
106
|
+
expect.anything(),
|
|
107
|
+
expect.anything()
|
|
108
|
+
);
|
|
76
109
|
});
|
|
77
110
|
|
|
78
111
|
it('M intercept only once W startTracking { called multiple times }', async () => {
|
|
@@ -82,26 +115,27 @@ it('M intercept only once W startTracking { called multiple times }', async () =
|
|
|
82
115
|
DdRumUserInteractionTracking.startTracking();
|
|
83
116
|
const { getByText } = render(
|
|
84
117
|
<View>
|
|
85
|
-
<Button
|
|
86
|
-
title="Click me"
|
|
87
|
-
accessibilityLabel="click_me_button"
|
|
88
|
-
onPress={event => {}}
|
|
89
|
-
/>
|
|
118
|
+
<Button title="Click me" onPress={event => {}} />
|
|
90
119
|
</View>
|
|
91
120
|
);
|
|
92
121
|
const testButton = getByText('Click me');
|
|
93
122
|
|
|
94
123
|
// WHEN
|
|
95
|
-
fireEvent(testButton, 'press'
|
|
124
|
+
fireEvent(testButton, 'press', {
|
|
125
|
+
_targetInst: {
|
|
126
|
+
memoizedProps: {
|
|
127
|
+
accessibilityLabel: 'click_me_button'
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
96
131
|
|
|
97
132
|
// THEN
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
expect(mockedInterceptOnPressFunction).toBeCalled();
|
|
133
|
+
expect(DdRum.addAction).toBeCalledWith(
|
|
134
|
+
'TAP',
|
|
135
|
+
'click_me_button',
|
|
136
|
+
expect.anything(),
|
|
137
|
+
expect.anything()
|
|
138
|
+
);
|
|
105
139
|
});
|
|
106
140
|
|
|
107
141
|
it('M intercept and send a RUM event W onPress { TouchableOpacity component }', async () => {
|
|
@@ -109,11 +143,7 @@ it('M intercept and send a RUM event W onPress { TouchableOpacity component }',
|
|
|
109
143
|
DdRumUserInteractionTracking.startTracking();
|
|
110
144
|
const { getByText } = render(
|
|
111
145
|
<View>
|
|
112
|
-
<TouchableOpacity
|
|
113
|
-
style={styles.button}
|
|
114
|
-
accessibilityLabel="click_me_touchable_opacity"
|
|
115
|
-
onPress={event => {}}
|
|
116
|
-
>
|
|
146
|
+
<TouchableOpacity style={styles.button} onPress={event => {}}>
|
|
117
147
|
<Text>Click me</Text>
|
|
118
148
|
</TouchableOpacity>
|
|
119
149
|
</View>
|
|
@@ -121,16 +151,21 @@ it('M intercept and send a RUM event W onPress { TouchableOpacity component }',
|
|
|
121
151
|
const testButton = getByText('Click me');
|
|
122
152
|
|
|
123
153
|
// WHEN
|
|
124
|
-
fireEvent(testButton, 'press'
|
|
154
|
+
fireEvent(testButton, 'press', {
|
|
155
|
+
_targetInst: {
|
|
156
|
+
memoizedProps: {
|
|
157
|
+
accessibilityLabel: 'click_me_button'
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
125
161
|
|
|
126
162
|
// THEN
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
expect(mockedInterceptOnPressFunction).toBeCalled();
|
|
163
|
+
expect(DdRum.addAction).toBeCalledWith(
|
|
164
|
+
'TAP',
|
|
165
|
+
'click_me_button',
|
|
166
|
+
expect.anything(),
|
|
167
|
+
expect.anything()
|
|
168
|
+
);
|
|
134
169
|
});
|
|
135
170
|
|
|
136
171
|
it('M intercept and send a RUM event W onPress { TouchableHighlight component }', async () => {
|
|
@@ -148,16 +183,21 @@ it('M intercept and send a RUM event W onPress { TouchableHighlight component }'
|
|
|
148
183
|
const testButton = getByText('Click me');
|
|
149
184
|
|
|
150
185
|
// WHEN
|
|
151
|
-
fireEvent(testButton, 'press'
|
|
186
|
+
fireEvent(testButton, 'press', {
|
|
187
|
+
_targetInst: {
|
|
188
|
+
memoizedProps: {
|
|
189
|
+
accessibilityLabel: 'click_me_button'
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
152
193
|
|
|
153
194
|
// THEN
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
expect(mockedInterceptOnPressFunction).toBeCalled();
|
|
195
|
+
expect(DdRum.addAction).toBeCalledWith(
|
|
196
|
+
'TAP',
|
|
197
|
+
'click_me_button',
|
|
198
|
+
expect.anything(),
|
|
199
|
+
expect.anything()
|
|
200
|
+
);
|
|
161
201
|
});
|
|
162
202
|
|
|
163
203
|
it('M intercept and send a RUM event W onPress { TouchableNativeFeedback component }', async () => {
|
|
@@ -175,16 +215,21 @@ it('M intercept and send a RUM event W onPress { TouchableNativeFeedback compone
|
|
|
175
215
|
const testButton = getByText('Click me');
|
|
176
216
|
|
|
177
217
|
// WHEN
|
|
178
|
-
fireEvent(testButton, 'press'
|
|
218
|
+
fireEvent(testButton, 'press', {
|
|
219
|
+
_targetInst: {
|
|
220
|
+
memoizedProps: {
|
|
221
|
+
accessibilityLabel: 'click_me_button'
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
179
225
|
|
|
180
226
|
// THEN
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
expect(mockedInterceptOnPressFunction).toBeCalled();
|
|
227
|
+
expect(DdRum.addAction).toBeCalledWith(
|
|
228
|
+
'TAP',
|
|
229
|
+
'click_me_button',
|
|
230
|
+
expect.anything(),
|
|
231
|
+
expect.anything()
|
|
232
|
+
);
|
|
188
233
|
});
|
|
189
234
|
|
|
190
235
|
it('M intercept and send a RUM event W onPress { TouchableWithoutFeedback component }', async () => {
|
|
@@ -202,16 +247,21 @@ it('M intercept and send a RUM event W onPress { TouchableWithoutFeedback compon
|
|
|
202
247
|
const testButton = getByText('Click me');
|
|
203
248
|
|
|
204
249
|
// WHEN
|
|
205
|
-
fireEvent(testButton, 'press'
|
|
250
|
+
fireEvent(testButton, 'press', {
|
|
251
|
+
_targetInst: {
|
|
252
|
+
memoizedProps: {
|
|
253
|
+
accessibilityLabel: 'click_me_button'
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
});
|
|
206
257
|
|
|
207
258
|
// THEN
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
expect(mockedInterceptOnPressFunction).toBeCalled();
|
|
259
|
+
expect(DdRum.addAction).toBeCalledWith(
|
|
260
|
+
'TAP',
|
|
261
|
+
'click_me_button',
|
|
262
|
+
expect.anything(),
|
|
263
|
+
expect.anything()
|
|
264
|
+
);
|
|
215
265
|
});
|
|
216
266
|
|
|
217
267
|
describe('startTracking memoization', () => {
|
package/src/logs/DdLogs.ts
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* Copyright 2016-Present Datadog, Inc.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { NativeModules } from 'react-native';
|
|
8
|
-
|
|
9
7
|
import { DATADOG_MESSAGE_PREFIX, InternalLog } from '../InternalLog';
|
|
10
8
|
import { SdkVerbosity } from '../SdkVerbosity';
|
|
11
9
|
import type { DdNativeLogsType } from '../nativeModulesTypes';
|
|
@@ -39,10 +37,12 @@ const isLogWithError = (
|
|
|
39
37
|
};
|
|
40
38
|
|
|
41
39
|
class DdLogsWrapper implements DdLogsType {
|
|
42
|
-
|
|
40
|
+
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
41
|
+
private nativeLogs: DdNativeLogsType = require('../specs/NativeDdLogs')
|
|
42
|
+
.default;
|
|
43
43
|
private logEventMapper = generateEventMapper(undefined);
|
|
44
44
|
|
|
45
|
-
debug(...args: LogArguments | LogWithErrorArguments): Promise<void> {
|
|
45
|
+
debug = (...args: LogArguments | LogWithErrorArguments): Promise<void> => {
|
|
46
46
|
if (isLogWithError(args)) {
|
|
47
47
|
return this.logWithError(
|
|
48
48
|
args[0],
|
|
@@ -54,9 +54,9 @@ class DdLogsWrapper implements DdLogsType {
|
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
return this.log(args[0], args[1] || {}, 'debug');
|
|
57
|
-
}
|
|
57
|
+
};
|
|
58
58
|
|
|
59
|
-
info(...args: LogArguments | LogWithErrorArguments): Promise<void> {
|
|
59
|
+
info = (...args: LogArguments | LogWithErrorArguments): Promise<void> => {
|
|
60
60
|
if (isLogWithError(args)) {
|
|
61
61
|
return this.logWithError(
|
|
62
62
|
args[0],
|
|
@@ -68,9 +68,9 @@ class DdLogsWrapper implements DdLogsType {
|
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
return this.log(args[0], args[1] || {}, 'info');
|
|
71
|
-
}
|
|
71
|
+
};
|
|
72
72
|
|
|
73
|
-
warn(...args: LogArguments | LogWithErrorArguments): Promise<void> {
|
|
73
|
+
warn = (...args: LogArguments | LogWithErrorArguments): Promise<void> => {
|
|
74
74
|
if (isLogWithError(args)) {
|
|
75
75
|
return this.logWithError(
|
|
76
76
|
args[0],
|
|
@@ -82,9 +82,9 @@ class DdLogsWrapper implements DdLogsType {
|
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
return this.log(args[0], args[1] || {}, 'warn');
|
|
85
|
-
}
|
|
85
|
+
};
|
|
86
86
|
|
|
87
|
-
error(...args: LogArguments | LogWithErrorArguments): Promise<void> {
|
|
87
|
+
error = (...args: LogArguments | LogWithErrorArguments): Promise<void> => {
|
|
88
88
|
if (isLogWithError(args)) {
|
|
89
89
|
return this.logWithError(
|
|
90
90
|
args[0],
|
|
@@ -96,7 +96,7 @@ class DdLogsWrapper implements DdLogsType {
|
|
|
96
96
|
);
|
|
97
97
|
}
|
|
98
98
|
return this.log(args[0], args[1] || {}, 'error');
|
|
99
|
-
}
|
|
99
|
+
};
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Since the InternalLog does not have a verbosity set yet in this case,
|