nightingale-react-native-console 18.1.0 → 18.2.0
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/CHANGELOG.md +339 -38
- package/LICENSE +11 -13
- package/README.md +5 -22
- package/lib/index.js +1 -0
- package/package.json +22 -55
- package/dist/definitions/index.d.ts +0 -8
- package/dist/definitions/index.d.ts.map +0 -1
- package/dist/index-browser.es.js +0 -47
- package/dist/index-browser.es.js.map +0 -1
- package/src/index.ts +0 -84
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [18.2.0](https://github.com/christophehurpeau/nightingale/compare/v18.1.0...v18.2.0) (2026-06-12)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* update nightingale-app-react-native package and deprecate nightingale-react-native-console
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* cast error stack to string for compatibility with React Native versions
|
|
15
|
+
|
|
16
|
+
Version bump for dependency: nightingale-app-react-native
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
## [18.1.0](https://github.com/christophehurpeau/nightingale/compare/v18.0.0...v18.1.0) (2025-11-18)
|
|
7
20
|
|
|
8
21
|
Version bump for dependency: nightingale
|
|
@@ -20,6 +33,7 @@ Version bump for dependency: nightingale
|
|
|
20
33
|
|
|
21
34
|
Version bump for dependency: nightingale
|
|
22
35
|
Version bump for dependency: nightingale-types
|
|
36
|
+
Version bump for dependency: nightingale-levels
|
|
23
37
|
|
|
24
38
|
|
|
25
39
|
## [17.0.1](https://github.com/christophehurpeau/nightingale/compare/v17.0.0...v17.0.1) (2025-10-22)
|
|
@@ -29,17 +43,9 @@ Version bump for dependency: nightingale
|
|
|
29
43
|
|
|
30
44
|
## [17.0.0](https://github.com/christophehurpeau/nightingale/compare/v16.2.0...v17.0.0) (2025-10-20)
|
|
31
45
|
|
|
32
|
-
### ⚠ BREAKING CHANGES
|
|
33
|
-
|
|
34
|
-
* harmonize formatter return type
|
|
35
|
-
|
|
36
|
-
### Features
|
|
37
|
-
|
|
38
|
-
* add export for react-native ([4098304](https://github.com/christophehurpeau/nightingale/commit/4098304ff9b6665930b7316fe05e0baf0b2e3fe5))
|
|
39
|
-
* harmonize formatter return type ([62771db](https://github.com/christophehurpeau/nightingale/commit/62771db963ee6a48de0a05a41aa4f5f09ac14d19))
|
|
40
|
-
|
|
41
46
|
Version bump for dependency: nightingale
|
|
42
47
|
Version bump for dependency: nightingale-types
|
|
48
|
+
Version bump for dependency: nightingale-levels
|
|
43
49
|
|
|
44
50
|
|
|
45
51
|
## [16.2.0](https://github.com/christophehurpeau/nightingale/compare/v16.1.0...v16.2.0) (2025-03-30)
|
|
@@ -62,8 +68,13 @@ Version bump for dependency: nightingale
|
|
|
62
68
|
|
|
63
69
|
* drop node 18 ([1b11a55](https://github.com/christophehurpeau/nightingale/commit/1b11a55dd24c9435be50519a748316079f554414))
|
|
64
70
|
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
* fix lib exports ([5b562b2](https://github.com/christophehurpeau/nightingale/commit/5b562b245aac1aa86b728a9433f3c9d28c62fe04))
|
|
74
|
+
|
|
65
75
|
Version bump for dependency: nightingale
|
|
66
76
|
Version bump for dependency: nightingale-types
|
|
77
|
+
Version bump for dependency: nightingale-levels
|
|
67
78
|
|
|
68
79
|
|
|
69
80
|
## [15.0.0](https://github.com/christophehurpeau/nightingale/compare/v14.2.1...v15.0.0) (2023-12-25)
|
|
@@ -77,31 +88,32 @@ Version bump for dependency: nightingale-types
|
|
|
77
88
|
|
|
78
89
|
* update babel and drop browser modern version ([5c76abc](https://github.com/christophehurpeau/nightingale/commit/5c76abc8bfb595a617fc4c8b795dae7e674ea664))
|
|
79
90
|
|
|
80
|
-
Version bump for dependency: nightingale-
|
|
91
|
+
Version bump for dependency: nightingale-formatter
|
|
81
92
|
Version bump for dependency: nightingale-types
|
|
93
|
+
Version bump for dependency: nightingale-levels
|
|
82
94
|
|
|
83
95
|
|
|
84
96
|
## [14.2.1](https://github.com/christophehurpeau/nightingale/compare/v14.2.0...v14.2.1) (2023-11-05)
|
|
85
97
|
|
|
86
98
|
Note: no notable changes
|
|
87
99
|
|
|
88
|
-
Version bump for dependency: nightingale-
|
|
100
|
+
Version bump for dependency: nightingale-formatter
|
|
89
101
|
Version bump for dependency: nightingale-types
|
|
102
|
+
Version bump for dependency: nightingale-levels
|
|
90
103
|
|
|
91
104
|
|
|
92
105
|
## [14.2.0](https://github.com/christophehurpeau/nightingale/compare/v14.1.0...v14.2.0) (2023-11-04)
|
|
93
106
|
|
|
107
|
+
Note: no notable changes
|
|
94
108
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
* **nightingale-react-native-console:** fix stack log ([edcc9b5](https://github.com/christophehurpeau/nightingale/commit/edcc9b593655bee8edb743c6214b34590f0ff118))
|
|
98
|
-
Version bump for dependency: nightingale-ansi-formatter
|
|
109
|
+
Version bump for dependency: nightingale-formatter
|
|
99
110
|
Version bump for dependency: nightingale-types
|
|
111
|
+
Version bump for dependency: nightingale-levels
|
|
100
112
|
|
|
101
113
|
|
|
102
114
|
## [14.1.0](https://github.com/christophehurpeau/nightingale/compare/v14.0.2...v14.1.0) (2023-07-27)
|
|
103
115
|
|
|
104
|
-
**Note:** Version bump only for package nightingale-
|
|
116
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
105
117
|
|
|
106
118
|
|
|
107
119
|
|
|
@@ -179,7 +191,7 @@ Version bump for dependency: nightingale-types
|
|
|
179
191
|
|
|
180
192
|
## [12.1.3](https://github.com/christophehurpeau/nightingale/compare/v12.1.2...v12.1.3) (2022-01-15)
|
|
181
193
|
|
|
182
|
-
**Note:** Version bump only for package nightingale-
|
|
194
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
183
195
|
|
|
184
196
|
|
|
185
197
|
|
|
@@ -187,7 +199,10 @@ Version bump for dependency: nightingale-types
|
|
|
187
199
|
|
|
188
200
|
## [12.1.2](https://github.com/christophehurpeau/nightingale/compare/v12.1.1...v12.1.2) (2022-01-02)
|
|
189
201
|
|
|
190
|
-
|
|
202
|
+
|
|
203
|
+
### Bug Fixes
|
|
204
|
+
|
|
205
|
+
* main esm for jest which supports esm but not exports ([98789fa](https://github.com/christophehurpeau/nightingale/commit/98789fa490e723840fccc443584189b6905d871b))
|
|
191
206
|
|
|
192
207
|
|
|
193
208
|
|
|
@@ -206,7 +221,7 @@ Version bump for dependency: nightingale-types
|
|
|
206
221
|
|
|
207
222
|
# [12.1.0](https://github.com/christophehurpeau/nightingale/compare/v12.0.1...v12.1.0) (2021-12-15)
|
|
208
223
|
|
|
209
|
-
**Note:** Version bump only for package nightingale-
|
|
224
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
210
225
|
|
|
211
226
|
|
|
212
227
|
|
|
@@ -214,7 +229,7 @@ Version bump for dependency: nightingale-types
|
|
|
214
229
|
|
|
215
230
|
## [12.0.1](https://github.com/christophehurpeau/nightingale/compare/v12.0.0...v12.0.1) (2021-12-12)
|
|
216
231
|
|
|
217
|
-
**Note:** Version bump only for package nightingale-
|
|
232
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
218
233
|
|
|
219
234
|
|
|
220
235
|
|
|
@@ -236,88 +251,374 @@ Version bump for dependency: nightingale-types
|
|
|
236
251
|
|
|
237
252
|
|
|
238
253
|
|
|
239
|
-
|
|
254
|
+
## [11.7.4](https://github.com/christophehurpeau/nightingale/compare/v11.7.3...v11.7.4) (2021-11-27)
|
|
255
|
+
|
|
256
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
## [11.7.2](https://github.com/christophehurpeau/nightingale/compare/v11.7.1...v11.7.2) (2021-11-27)
|
|
263
|
+
|
|
264
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## [11.7.1](https://github.com/christophehurpeau/nightingale/compare/v11.7.0...v11.7.1) (2021-06-29)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
### Bug Fixes
|
|
274
|
+
|
|
275
|
+
* update pob-babel to bring back webpack 4 support ([4887431](https://github.com/christophehurpeau/nightingale/commit/4887431b3b272496511f879af022638723b9056e))
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
# [11.7.0](https://github.com/christophehurpeau/nightingale/compare/v11.6.0...v11.7.0) (2021-03-29)
|
|
282
|
+
|
|
283
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
# [11.6.0](https://github.com/christophehurpeau/nightingale/compare/v11.5.4...v11.6.0) (2021-03-21)
|
|
240
290
|
|
|
241
291
|
|
|
242
292
|
### Features
|
|
243
293
|
|
|
244
|
-
*
|
|
294
|
+
* update dependencies and browserlist config ([81d2340](https://github.com/christophehurpeau/nightingale/commit/81d234069412c746ebc99faed778092790f332ca))
|
|
245
295
|
|
|
246
296
|
|
|
247
297
|
|
|
248
298
|
|
|
249
299
|
|
|
250
|
-
## [11.
|
|
300
|
+
## [11.5.2](https://github.com/christophehurpeau/nightingale/compare/v11.5.1...v11.5.2) (2021-02-14)
|
|
301
|
+
|
|
302
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
# [11.3.0](https://github.com/christophehurpeau/nightingale/compare/v11.2.0...v11.3.0) (2021-02-06)
|
|
309
|
+
|
|
310
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
# [11.2.0](https://github.com/christophehurpeau/nightingale/compare/v11.1.1...v11.2.0) (2021-02-04)
|
|
251
317
|
|
|
252
318
|
|
|
253
319
|
### Bug Fixes
|
|
254
320
|
|
|
255
|
-
*
|
|
321
|
+
* missing "browser" in package.json ([cce81cb](https://github.com/christophehurpeau/nightingale/commit/cce81cb3f8f52f18049f0a2f49944920ee027fad))
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
## [11.1.1](https://github.com/christophehurpeau/nightingale/compare/v11.1.0...v11.1.1) (2021-01-31)
|
|
256
328
|
|
|
329
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
257
330
|
|
|
258
331
|
|
|
259
332
|
|
|
260
333
|
|
|
261
|
-
|
|
334
|
+
|
|
335
|
+
# [11.1.0](https://github.com/christophehurpeau/nightingale/compare/v11.0.5...v11.1.0) (2021-01-31)
|
|
336
|
+
|
|
337
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
## [11.0.5](https://github.com/christophehurpeau/nightingale/compare/v11.0.4...v11.0.5) (2021-01-18)
|
|
262
344
|
|
|
263
345
|
|
|
264
346
|
### Bug Fixes
|
|
265
347
|
|
|
266
|
-
*
|
|
348
|
+
* update pob-babel for better support ([44119b7](https://github.com/christophehurpeau/nightingale/commit/44119b72437e0572757a118985c7a205cb9d2e0a))
|
|
267
349
|
|
|
268
350
|
|
|
269
351
|
|
|
270
352
|
|
|
271
353
|
|
|
272
|
-
## [11.
|
|
354
|
+
## [11.0.3](https://github.com/christophehurpeau/nightingale/compare/v11.0.2...v11.0.3) (2021-01-18)
|
|
273
355
|
|
|
274
|
-
**Note:** Version bump only for package nightingale-react-native-console
|
|
275
356
|
|
|
357
|
+
### Bug Fixes
|
|
276
358
|
|
|
359
|
+
* import browser path ([d4469d4](https://github.com/christophehurpeau/nightingale/commit/d4469d400db56a8dc22838ae6308fdd607375566))
|
|
277
360
|
|
|
278
361
|
|
|
279
362
|
|
|
280
|
-
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
## [11.0.1](https://github.com/christophehurpeau/nightingale/compare/v11.0.0...v11.0.1) (2021-01-18)
|
|
281
366
|
|
|
282
367
|
|
|
283
368
|
### Bug Fixes
|
|
284
369
|
|
|
285
|
-
*
|
|
370
|
+
* bring back support for webpack 4 ([9134da3](https://github.com/christophehurpeau/nightingale/commit/9134da3b85fb46da826c4f59631942373b51f592))
|
|
286
371
|
|
|
287
372
|
|
|
288
373
|
|
|
289
374
|
|
|
290
375
|
|
|
291
|
-
# [11.
|
|
376
|
+
# [11.0.0](https://github.com/christophehurpeau/nightingale/compare/v10.0.1...v11.0.0) (2020-12-12)
|
|
292
377
|
|
|
293
|
-
**Note:** Version bump only for package nightingale-react-native-console
|
|
294
378
|
|
|
379
|
+
### Bug Fixes
|
|
295
380
|
|
|
381
|
+
* update devdeps and fix lerna config ([79e97dd](https://github.com/christophehurpeau/nightingale/commit/79e97dd8ad0750a2e5871d9fdeee49de1668bf77))
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
### Code Refactoring
|
|
385
|
+
|
|
386
|
+
* use yarn 2, requires node 12 ([73a85dd](https://github.com/christophehurpeau/nightingale/commit/73a85ddc37dbfe53b80fd6feea6cbd31874ea771))
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
### BREAKING CHANGES
|
|
390
|
+
|
|
391
|
+
* drop support for node 10
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
## [10.0.1](https://github.com/christophehurpeau/nightingale/compare/v10.0.0...v10.0.1) (2020-05-23)
|
|
398
|
+
|
|
399
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
296
400
|
|
|
297
401
|
|
|
298
402
|
|
|
299
|
-
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
# 10.0.0 (2020-05-23)
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
### Bug Fixes
|
|
409
|
+
|
|
410
|
+
* update dependencies and deprecate Record for LogRecord ([2d0a758](https://github.com/christophehurpeau/nightingale/commit/2d0a758))
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
### Code Refactoring
|
|
414
|
+
|
|
415
|
+
* use typescript ([2e465c6](https://github.com/christophehurpeau/nightingale/commit/2e465c6))
|
|
300
416
|
|
|
301
417
|
|
|
302
418
|
### Features
|
|
303
419
|
|
|
304
|
-
*
|
|
420
|
+
* drop node 6 ([e09773c](https://github.com/christophehurpeau/nightingale/commit/e09773c))
|
|
421
|
+
* lerna, rollup ([08f73b6](https://github.com/christophehurpeau/nightingale/commit/08f73b6))
|
|
422
|
+
* pob update ([8eb74d9](https://github.com/christophehurpeau/nightingale/commit/8eb74d9))
|
|
423
|
+
* pob upgrade ([e9090d1](https://github.com/christophehurpeau/nightingale/commit/e9090d1))
|
|
424
|
+
* support node 4 ([efee51e](https://github.com/christophehurpeau/nightingale/commit/efee51e))
|
|
425
|
+
* update dependencies ([08e82b5](https://github.com/christophehurpeau/nightingale/commit/08e82b5))
|
|
426
|
+
* update dependencies ([e2e8ef5](https://github.com/christophehurpeau/nightingale/commit/e2e8ef5))
|
|
427
|
+
* update dependencies ([a185796](https://github.com/christophehurpeau/nightingale/commit/a185796))
|
|
305
428
|
|
|
306
429
|
|
|
430
|
+
### BREAKING CHANGES
|
|
431
|
+
|
|
432
|
+
* requires node 10
|
|
433
|
+
* node 6 no longer supported
|
|
434
|
+
* node 4 is no longer supported
|
|
435
|
+
* remove deprecated dot support
|
|
436
|
+
|
|
307
437
|
|
|
308
438
|
|
|
309
439
|
|
|
310
|
-
## [11.5.2](https://github.com/christophehurpeau/nightingale/compare/v11.5.1...v11.5.2) (2021-02-14)
|
|
311
440
|
|
|
312
|
-
|
|
441
|
+
## [4.2.2](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@4.2.1...nightingale-raw-formatter@4.2.2) (2019-05-01)
|
|
313
442
|
|
|
443
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
314
444
|
|
|
315
445
|
|
|
316
446
|
|
|
317
447
|
|
|
318
|
-
|
|
448
|
+
|
|
449
|
+
## [4.2.1](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@4.2.0...nightingale-raw-formatter@4.2.1) (2019-04-05)
|
|
450
|
+
|
|
451
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
# [4.2.0](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@4.1.0...nightingale-raw-formatter@4.2.0) (2019-04-05)
|
|
319
458
|
|
|
320
459
|
|
|
321
460
|
### Features
|
|
322
461
|
|
|
323
|
-
*
|
|
462
|
+
* update dependencies ([e2e8ef5](https://github.com/christophehurpeau/nightingale/commit/e2e8ef5))
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
# [4.1.0](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@4.0.1...nightingale-raw-formatter@4.1.0) (2019-02-24)
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
### Bug Fixes
|
|
472
|
+
|
|
473
|
+
* update dependencies and deprecate Record for LogRecord ([2d0a758](https://github.com/christophehurpeau/nightingale/commit/2d0a758))
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
### Features
|
|
477
|
+
|
|
478
|
+
* update dependencies ([a185796](https://github.com/christophehurpeau/nightingale/commit/a185796))
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
## [4.0.1](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@4.0.0...nightingale-raw-formatter@4.0.1) (2018-12-03)
|
|
485
|
+
|
|
486
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
# [4.0.0](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@3.0.6...nightingale-raw-formatter@4.0.0) (2018-12-03)
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
### Features
|
|
496
|
+
|
|
497
|
+
* drop node 6 ([e09773c](https://github.com/christophehurpeau/nightingale/commit/e09773c))
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
### BREAKING CHANGES
|
|
501
|
+
|
|
502
|
+
* node 6 no longer supported
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
<a name="3.0.6"></a>
|
|
509
|
+
## [3.0.6](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@3.0.5...nightingale-raw-formatter@3.0.6) (2018-06-28)
|
|
510
|
+
|
|
511
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
<a name="3.0.5"></a>
|
|
518
|
+
## [3.0.5](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@3.0.4...nightingale-raw-formatter@3.0.5) (2018-06-17)
|
|
519
|
+
|
|
520
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
<a name="3.0.4"></a>
|
|
527
|
+
## [3.0.4](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@3.0.3...nightingale-raw-formatter@3.0.4) (2018-06-17)
|
|
528
|
+
|
|
529
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
<a name="3.0.3"></a>
|
|
536
|
+
## [3.0.3](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@3.0.2...nightingale-raw-formatter@3.0.3) (2018-05-26)
|
|
537
|
+
|
|
538
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
<a name="3.0.2"></a>
|
|
545
|
+
## [3.0.2](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@3.0.1...nightingale-raw-formatter@3.0.2) (2018-05-26)
|
|
546
|
+
|
|
547
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
<a name="3.0.1"></a>
|
|
554
|
+
## [3.0.1](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@3.0.0...nightingale-raw-formatter@3.0.1) (2018-05-10)
|
|
555
|
+
|
|
556
|
+
**Note:** Version bump only for package nightingale-raw-formatter
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
<a name="3.0.0"></a>
|
|
563
|
+
# [3.0.0](https://github.com/christophehurpeau/nightingale/compare/nightingale-raw-formatter@2.0.0...nightingale-raw-formatter@3.0.0) (2018-04-21)
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
### Code Refactoring
|
|
567
|
+
|
|
568
|
+
* use typescript ([2e465c6](https://github.com/christophehurpeau/nightingale/commit/2e465c6))
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
### BREAKING CHANGES
|
|
572
|
+
|
|
573
|
+
* node 4 is no longer supported
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
<a name="2.0.0"></a>
|
|
580
|
+
# 2.0.0 (2018-03-18)
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
### Features
|
|
584
|
+
|
|
585
|
+
* lerna, rollup ([08f73b6](https://github.com/christophehurpeau/nightingale/commit/08f73b6))
|
|
586
|
+
* pob upgrade ([e9090d1](https://github.com/christophehurpeau/nightingale/commit/e9090d1))
|
|
587
|
+
* support node 4 ([efee51e](https://github.com/christophehurpeau/nightingale/commit/efee51e))
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
### BREAKING CHANGES
|
|
591
|
+
|
|
592
|
+
* remove deprecated dot support
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
<a name="1.5.0"></a>
|
|
598
|
+
# [1.5.0](https://github.com/nightingalejs/nightingale-raw-formatter/compare/v1.4.0...v1.5.0) (2017-04-01)
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
### Features
|
|
602
|
+
|
|
603
|
+
* support node 4 ([95a260b](https://github.com/nightingalejs/nightingale-raw-formatter/commit/95a260b))
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
<a name="1.4.0"></a>
|
|
607
|
+
# [1.4.0](https://github.com/nightingalejs/nightingale-raw-formatter/compare/v1.3.0...v1.4.0) (2017-03-21)
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
<a name="1.3.0"></a>
|
|
611
|
+
# [1.3.0](https://github.com/nightingalejs/nightingale-raw-formatter/compare/v1.2.0...v1.3.0) (2017-02-28)
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
### Features
|
|
615
|
+
|
|
616
|
+
* pob upgrade ([f0a9ac2](https://github.com/nightingalejs/nightingale-raw-formatter/commit/f0a9ac2))
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
### v1.2.0
|
|
620
|
+
|
|
621
|
+
- [`ca1c74b`](https://github.com/nightingalejs/nightingale-raw-formatter/commit/ca1c74bb0a6bb8ecd2bcf67ef1efbf64df011b1e) use pob (Christophe Hurpeau)
|
|
622
|
+
- [`3aba438`](https://github.com/nightingalejs/nightingale-raw-formatter/commit/3aba43812ec61cb232e816f0ebfc1147b0558351) refactor: pob update (Christophe Hurpeau)
|
|
623
|
+
|
|
624
|
+
### v1.1.0
|
package/LICENSE
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
Copyright (c) 2016 Christophe Hurpeau
|
|
1
|
+
Copyright (c) 2012-2016 Christophe Hurpeau
|
|
2
2
|
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
copies.
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
4
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
5
|
+
and this permission notice appear in all copies.
|
|
7
6
|
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
9
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
11
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
12
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
13
|
+
THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</h1>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
React Native and Expo handler for nightingale
|
|
6
|
+
Deprecated: React Native and Expo handler for nightingale
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
@@ -11,36 +11,19 @@
|
|
|
11
11
|
<a href="https://npmjs.org/package/nightingale-react-native-console"><img src="https://img.shields.io/npm/dw/nightingale-react-native-console.svg?style=flat-square" alt="npm downloads"></a>
|
|
12
12
|
<a href="https://npmjs.org/package/nightingale-react-native-console"><img src="https://img.shields.io/node/v/nightingale-react-native-console.svg?style=flat-square" alt="node version"></a>
|
|
13
13
|
<a href="https://npmjs.org/package/nightingale-react-native-console"><img src="https://img.shields.io/npm/types/nightingale-react-native-console.svg?style=flat-square" alt="types"></a>
|
|
14
|
+
<a href="https://codecov.io/gh/christophehurpeau/nightingale"><img src="https://img.shields.io/codecov/c/github/christophehurpeau/nightingale/main.svg?style=flat-square"></a>
|
|
14
15
|
</p>
|
|
15
16
|
|
|
16
17
|
## Install
|
|
17
18
|
|
|
18
19
|
```sh
|
|
19
|
-
npm install --save nightingale
|
|
20
|
+
npm install --save nightingale
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
## Usage
|
|
23
24
|
|
|
24
|
-
:warn: This logger is meant for dev only.
|
|
25
|
-
|
|
26
25
|
```js
|
|
27
|
-
import {
|
|
28
|
-
import { ReactNativeConsoleHandler } from "nightingale-react-native-console";
|
|
26
|
+
import { RawFormatter } from "nightingale";
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
process.env.NODE_ENV === "production"
|
|
32
|
-
? []
|
|
33
|
-
: [
|
|
34
|
-
{
|
|
35
|
-
pattern: /^app(:|$)/,
|
|
36
|
-
handlers: [new ReactNativeConsoleHandler(Level.DEBUG)],
|
|
37
|
-
stop: true,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
handlers: [new ReactNativeConsoleHandler(Level.INFO)],
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
);
|
|
28
|
+
RawFormatter.format(record);
|
|
44
29
|
```
|
|
45
|
-
|
|
46
|
-
You can use directly [`nightingale-app-react-native`](https://npmjs.org/package/nightingale-app-react-native) to get this config and an ready to use `appLogger`.
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReactNativeConsoleHandler } from "nightingale-app-react-native";
|
package/package.json
CHANGED
|
@@ -1,86 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightingale-react-native-console",
|
|
3
|
-
"version": "18.
|
|
4
|
-
"description": "React Native and Expo handler for nightingale",
|
|
3
|
+
"version": "18.2.0",
|
|
4
|
+
"description": "Deprecated: React Native and Expo handler for nightingale",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"expo",
|
|
6
7
|
"nightingale",
|
|
7
8
|
"nightingale-handler",
|
|
8
|
-
"expo",
|
|
9
9
|
"react-native"
|
|
10
10
|
],
|
|
11
|
-
"
|
|
11
|
+
"homepage": "https://github.com/christophehurpeau/nightingale",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/christophehurpeau/nightingale/issues"
|
|
14
|
+
},
|
|
12
15
|
"license": "ISC",
|
|
16
|
+
"author": "Christophe Hurpeau <christophe@hurpeau.com> (http://christophe.hurpeau.com/)",
|
|
13
17
|
"repository": {
|
|
14
18
|
"type": "git",
|
|
15
19
|
"url": "https://github.com/christophehurpeau/nightingale.git",
|
|
16
20
|
"directory": "packages/nightingale-react-native-console"
|
|
17
21
|
},
|
|
18
|
-
"
|
|
22
|
+
"files": [
|
|
23
|
+
"lib"
|
|
24
|
+
],
|
|
19
25
|
"type": "module",
|
|
20
|
-
"engines": {
|
|
21
|
-
"node": ">=22.18.0"
|
|
22
|
-
},
|
|
23
26
|
"sideEffects": false,
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"browser": "./dist/index-browser.es.js",
|
|
27
|
+
"main": "./lib/index.js",
|
|
28
|
+
"types": "./lib/index.d.ts",
|
|
27
29
|
"exports": {
|
|
28
30
|
"./package.json": "./package.json",
|
|
29
31
|
".": {
|
|
30
|
-
"types": "./
|
|
31
|
-
"
|
|
32
|
-
"import": "./dist/index-browser.es.js"
|
|
33
|
-
}
|
|
32
|
+
"types": "./lib/index.d.ts",
|
|
33
|
+
"default": "./lib/index.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"files": [
|
|
37
|
-
"src",
|
|
38
|
-
"dist"
|
|
39
|
-
],
|
|
40
36
|
"scripts": {
|
|
41
|
-
"build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
|
|
42
|
-
"build:definitions": "tsc -p tsconfig.json",
|
|
43
37
|
"clean": "yarn clean:build",
|
|
44
|
-
"clean:build": "pob-esbuild-clean-out dist",
|
|
45
38
|
"lint": "yarn run lint:eslint",
|
|
46
|
-
"lint:eslint": "yarn ../.. run eslint --quiet packages/nightingale-react-native-console",
|
|
39
|
+
"lint:eslint": "yarn '../..' run eslint --quiet 'packages/nightingale-react-native-console'",
|
|
40
|
+
"test": "yarn '../..' run test -- 'packages/nightingale-react-native-console'",
|
|
47
41
|
"watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
|
|
48
42
|
},
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"defaults",
|
|
52
|
-
"> 0.2%",
|
|
53
|
-
"not ie < 12",
|
|
54
|
-
"not safari < 10",
|
|
55
|
-
"not ios_saf < 10"
|
|
56
|
-
]
|
|
57
|
-
},
|
|
58
|
-
"pob": {
|
|
59
|
-
"bundler": "rollup-esbuild",
|
|
60
|
-
"entries": [
|
|
61
|
-
"index"
|
|
62
|
-
],
|
|
63
|
-
"envs": [
|
|
64
|
-
{
|
|
65
|
-
"target": "browser"
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"typescript": true
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"nightingale-app-react-native": "18.2.0"
|
|
69
45
|
},
|
|
70
|
-
"prettier": "@pob/root/prettier-config",
|
|
71
46
|
"peerDependencies": {
|
|
72
47
|
"react-native": "*"
|
|
73
48
|
},
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"nightingale-types": "18.0.0"
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=22.18.0"
|
|
77
51
|
},
|
|
78
|
-
"
|
|
79
|
-
"@pob/rollup-esbuild": "7.3.2",
|
|
80
|
-
"react": "19.1.0",
|
|
81
|
-
"react-dom": "19.1.0",
|
|
82
|
-
"react-native": "0.80.0",
|
|
83
|
-
"react-native-web": "0.21.2",
|
|
84
|
-
"typescript": "5.9.3"
|
|
85
|
-
}
|
|
52
|
+
"pob": {}
|
|
86
53
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Handle, Handler, IsHandling, Level } from "nightingale-types";
|
|
2
|
-
export declare class ReactNativeConsoleHandler implements Handler {
|
|
3
|
-
minLevel: Level;
|
|
4
|
-
handle: Handle;
|
|
5
|
-
isHandling: IsHandling;
|
|
6
|
-
constructor(minLevel: Level);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAK,EAGN,MAAM,mBAAmB,CAAC;AA6D3B,qBAAa,yBAA0B,YAAW,OAAO;IACvD,QAAQ,EAAE,KAAK,CAAK;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,UAAU,EAAE,UAAU,CAAC;gBAEX,QAAQ,EAAE,KAAK;CAK5B"}
|
package/dist/index-browser.es.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ANSIFormatter } from 'nightingale';
|
|
2
|
-
import { Platform } from 'react-native-web';
|
|
3
|
-
import parseErrorStack from 'react-native/Libraries/Core/Devtools/parseErrorStack';
|
|
4
|
-
import symbolicateStackTrace from 'react-native/Libraries/Core/Devtools/symbolicateStackTrace';
|
|
5
|
-
|
|
6
|
-
const getStackTrace = (e) => {
|
|
7
|
-
if (Platform.hasOwnProperty("constants")) {
|
|
8
|
-
if (Platform.constants.reactNativeVersion.minor >= 64) {
|
|
9
|
-
return parseErrorStack(e.stack);
|
|
10
|
-
} else return parseErrorStack(e);
|
|
11
|
-
} else return parseErrorStack(e);
|
|
12
|
-
};
|
|
13
|
-
function parsedStackToString(stack) {
|
|
14
|
-
return stack.map(
|
|
15
|
-
(frame) => ` at ${frame.file}${frame.lineNumber ? `:${frame.lineNumber}${frame.column ? `:${frame.column}` : ""}` : ""}${frame.methodName ? ` in ${frame.methodName}` : ""}`
|
|
16
|
-
).join("\n");
|
|
17
|
-
}
|
|
18
|
-
function consoleOutput(param, record) {
|
|
19
|
-
console.log(...param);
|
|
20
|
-
}
|
|
21
|
-
const createHandle = () => {
|
|
22
|
-
return (record) => {
|
|
23
|
-
const metadataError = record.metadata?.error;
|
|
24
|
-
if (metadataError && metadataError instanceof Error) {
|
|
25
|
-
symbolicateStackTrace(getStackTrace(metadataError)).then(({ stack, codeFrame }) => {
|
|
26
|
-
metadataError.stack = parsedStackToString(stack);
|
|
27
|
-
consoleOutput(ANSIFormatter.format(record));
|
|
28
|
-
}).catch((error) => {
|
|
29
|
-
metadataError.stack = void 0;
|
|
30
|
-
consoleOutput(ANSIFormatter.format(record));
|
|
31
|
-
});
|
|
32
|
-
} else {
|
|
33
|
-
consoleOutput(ANSIFormatter.format(record));
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
class ReactNativeConsoleHandler {
|
|
38
|
-
constructor(minLevel) {
|
|
39
|
-
this.minLevel = 0;
|
|
40
|
-
this.minLevel = minLevel;
|
|
41
|
-
this.isHandling = (level) => level >= minLevel;
|
|
42
|
-
this.handle = createHandle();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { ReactNativeConsoleHandler };
|
|
47
|
-
//# sourceMappingURL=index-browser.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-browser.es.js","sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-argument */\n\nimport { ANSIFormatter } from \"nightingale\";\nimport type {\n Handle,\n Handler,\n IsHandling,\n Level,\n LogRecord,\n Metadata,\n} from \"nightingale-types\";\nimport { Platform } from \"react-native\";\nimport type { StackFrame } from \"react-native/Libraries/Core/Devtools/parseErrorStack\";\nimport parseErrorStack from \"react-native/Libraries/Core/Devtools/parseErrorStack\";\nimport symbolicateStackTrace from \"react-native/Libraries/Core/Devtools/symbolicateStackTrace\";\n\nconst getStackTrace = (e: Error): any => {\n // eslint-disable-next-line no-prototype-builtins\n if (Platform.hasOwnProperty(\"constants\")) {\n // RN version >= 0.63\n if (Platform.constants.reactNativeVersion.minor >= 64) {\n // RN version >= 0.64 -> Stacktrace as string\n return parseErrorStack(e.stack as unknown as any);\n }\n // RN version == 0.63 -> Stacktrace as string\n else return parseErrorStack(e);\n }\n // RN version < 0.63 -> Stacktrace as string\n else return parseErrorStack(e);\n};\n\nfunction parsedStackToString(stack: StackFrame[]): string {\n return stack\n .map(\n (frame) =>\n ` at ${frame.file}${\n frame.lineNumber\n ? `:${frame.lineNumber}${frame.column ? `:${frame.column}` : \"\"}`\n : \"\"\n }${frame.methodName ? ` in ${frame.methodName}` : \"\"}`,\n )\n .join(\"\\n\");\n}\n\nfunction consoleOutput<T extends Metadata>(\n param: string[],\n record: LogRecord<T>,\n): void {\n // eslint-disable-next-line no-console\n console.log(...param);\n}\n\nconst createHandle = (): Handle => {\n return <T extends Metadata>(record: LogRecord<T>): void => {\n const metadataError = record.metadata?.error;\n if (metadataError && metadataError instanceof Error) {\n symbolicateStackTrace(getStackTrace(metadataError))\n .then(({ stack, codeFrame }: any) => {\n metadataError.stack = parsedStackToString(stack);\n consoleOutput(ANSIFormatter.format(record), record);\n })\n .catch((error: unknown) => {\n metadataError.stack = undefined;\n consoleOutput(ANSIFormatter.format(record), record);\n });\n } else {\n consoleOutput(ANSIFormatter.format(record), record);\n }\n };\n};\n\nexport class ReactNativeConsoleHandler implements Handler {\n minLevel: Level = 0;\n\n handle: Handle;\n\n isHandling: IsHandling;\n\n constructor(minLevel: Level) {\n this.minLevel = minLevel;\n this.isHandling = (level: Level) => level >= minLevel;\n this.handle = createHandle();\n }\n}\n"],"names":[],"mappings":";;;;;AAgBA,MAAM,aAAA,GAAgB,CAAC,CAAA,KAAkB;AAEvC,EAAA,IAAI,QAAA,CAAS,cAAA,CAAe,WAAW,CAAA,EAAG;AAExC,IAAA,IAAI,QAAA,CAAS,SAAA,CAAU,kBAAA,CAAmB,KAAA,IAAS,EAAA,EAAI;AAErD,MAAA,OAAO,eAAA,CAAgB,EAAE,KAAuB,CAAA;AAAA,IAClD,CAAA,MAEK,OAAO,eAAA,CAAgB,CAAC,CAAA;AAAA,EAC/B,CAAA,MAEK,OAAO,eAAA,CAAgB,CAAC,CAAA;AAC/B,CAAA;AAEA,SAAS,oBAAoB,KAAA,EAA6B;AACxD,EAAA,OAAO,KAAA,CACJ,GAAA;AAAA,IACC,CAAC,KAAA,KACC,CAAA,KAAA,EAAQ,KAAA,CAAM,IAAI,CAAA,EAChB,KAAA,CAAM,UAAA,GACF,CAAA,CAAA,EAAI,KAAA,CAAM,UAAU,CAAA,EAAG,KAAA,CAAM,MAAA,GAAS,CAAA,CAAA,EAAI,KAAA,CAAM,MAAM,CAAA,CAAA,GAAK,EAAE,CAAA,CAAA,GAC7D,EACN,CAAA,EAAG,KAAA,CAAM,UAAA,GAAa,CAAA,IAAA,EAAO,KAAA,CAAM,UAAU,CAAA,CAAA,GAAK,EAAE,CAAA;AAAA,GACxD,CACC,KAAK,IAAI,CAAA;AACd;AAEA,SAAS,aAAA,CACP,OACA,MAAA,EACM;AAEN,EAAA,OAAA,CAAQ,GAAA,CAAI,GAAG,KAAK,CAAA;AACtB;AAEA,MAAM,eAAe,MAAc;AACjC,EAAA,OAAO,CAAqB,MAAA,KAA+B;AACzD,IAAA,MAAM,aAAA,GAAgB,OAAO,QAAA,EAAU,KAAA;AACvC,IAAA,IAAI,aAAA,IAAiB,yBAAyB,KAAA,EAAO;AACnD,MAAA,qBAAA,CAAsB,aAAA,CAAc,aAAa,CAAC,CAAA,CAC/C,KAAK,CAAC,EAAE,KAAA,EAAO,SAAA,EAAU,KAAW;AACnC,QAAA,aAAA,CAAc,KAAA,GAAQ,oBAAoB,KAAK,CAAA;AAC/C,QAAA,aAAA,CAAc,aAAA,CAAc,MAAA,CAAO,MAAM,CAAS,CAAA;AAAA,MACpD,CAAC,CAAA,CACA,KAAA,CAAM,CAAC,KAAA,KAAmB;AACzB,QAAA,aAAA,CAAc,KAAA,GAAQ,MAAA;AACtB,QAAA,aAAA,CAAc,aAAA,CAAc,MAAA,CAAO,MAAM,CAAS,CAAA;AAAA,MACpD,CAAC,CAAA;AAAA,IACL,CAAA,MAAO;AACL,MAAA,aAAA,CAAc,aAAA,CAAc,MAAA,CAAO,MAAM,CAAS,CAAA;AAAA,IACpD;AAAA,EACF,CAAA;AACF,CAAA;AAEO,MAAM,yBAAA,CAA6C;AAAA,EAOxD,YAAY,QAAA,EAAiB;AAN7B,IAAA,IAAA,CAAA,QAAA,GAAkB,CAAA;AAOhB,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAChB,IAAA,IAAA,CAAK,UAAA,GAAa,CAAC,KAAA,KAAiB,KAAA,IAAS,QAAA;AAC7C,IAAA,IAAA,CAAK,SAAS,YAAA,EAAa;AAAA,EAC7B;AACF;;;;"}
|
package/src/index.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
|
-
|
|
3
|
-
import { ANSIFormatter } from "nightingale";
|
|
4
|
-
import type {
|
|
5
|
-
Handle,
|
|
6
|
-
Handler,
|
|
7
|
-
IsHandling,
|
|
8
|
-
Level,
|
|
9
|
-
LogRecord,
|
|
10
|
-
Metadata,
|
|
11
|
-
} from "nightingale-types";
|
|
12
|
-
import { Platform } from "react-native";
|
|
13
|
-
import type { StackFrame } from "react-native/Libraries/Core/Devtools/parseErrorStack";
|
|
14
|
-
import parseErrorStack from "react-native/Libraries/Core/Devtools/parseErrorStack";
|
|
15
|
-
import symbolicateStackTrace from "react-native/Libraries/Core/Devtools/symbolicateStackTrace";
|
|
16
|
-
|
|
17
|
-
const getStackTrace = (e: Error): any => {
|
|
18
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
19
|
-
if (Platform.hasOwnProperty("constants")) {
|
|
20
|
-
// RN version >= 0.63
|
|
21
|
-
if (Platform.constants.reactNativeVersion.minor >= 64) {
|
|
22
|
-
// RN version >= 0.64 -> Stacktrace as string
|
|
23
|
-
return parseErrorStack(e.stack as unknown as any);
|
|
24
|
-
}
|
|
25
|
-
// RN version == 0.63 -> Stacktrace as string
|
|
26
|
-
else return parseErrorStack(e);
|
|
27
|
-
}
|
|
28
|
-
// RN version < 0.63 -> Stacktrace as string
|
|
29
|
-
else return parseErrorStack(e);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
function parsedStackToString(stack: StackFrame[]): string {
|
|
33
|
-
return stack
|
|
34
|
-
.map(
|
|
35
|
-
(frame) =>
|
|
36
|
-
` at ${frame.file}${
|
|
37
|
-
frame.lineNumber
|
|
38
|
-
? `:${frame.lineNumber}${frame.column ? `:${frame.column}` : ""}`
|
|
39
|
-
: ""
|
|
40
|
-
}${frame.methodName ? ` in ${frame.methodName}` : ""}`,
|
|
41
|
-
)
|
|
42
|
-
.join("\n");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function consoleOutput<T extends Metadata>(
|
|
46
|
-
param: string[],
|
|
47
|
-
record: LogRecord<T>,
|
|
48
|
-
): void {
|
|
49
|
-
// eslint-disable-next-line no-console
|
|
50
|
-
console.log(...param);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const createHandle = (): Handle => {
|
|
54
|
-
return <T extends Metadata>(record: LogRecord<T>): void => {
|
|
55
|
-
const metadataError = record.metadata?.error;
|
|
56
|
-
if (metadataError && metadataError instanceof Error) {
|
|
57
|
-
symbolicateStackTrace(getStackTrace(metadataError))
|
|
58
|
-
.then(({ stack, codeFrame }: any) => {
|
|
59
|
-
metadataError.stack = parsedStackToString(stack);
|
|
60
|
-
consoleOutput(ANSIFormatter.format(record), record);
|
|
61
|
-
})
|
|
62
|
-
.catch((error: unknown) => {
|
|
63
|
-
metadataError.stack = undefined;
|
|
64
|
-
consoleOutput(ANSIFormatter.format(record), record);
|
|
65
|
-
});
|
|
66
|
-
} else {
|
|
67
|
-
consoleOutput(ANSIFormatter.format(record), record);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export class ReactNativeConsoleHandler implements Handler {
|
|
73
|
-
minLevel: Level = 0;
|
|
74
|
-
|
|
75
|
-
handle: Handle;
|
|
76
|
-
|
|
77
|
-
isHandling: IsHandling;
|
|
78
|
-
|
|
79
|
-
constructor(minLevel: Level) {
|
|
80
|
-
this.minLevel = minLevel;
|
|
81
|
-
this.isHandling = (level: Level) => level >= minLevel;
|
|
82
|
-
this.handle = createHandle();
|
|
83
|
-
}
|
|
84
|
-
}
|