1
+ [ ![ Build Status] ( https://travis-ci.org/imranMnts/react-native-logging-tools.svg?branch=develop )] ( https://travis-ci.org/imranMnts/react-native-logging-tools )
2
+ ![ npm] ( https://img.shields.io/npm/v/react-native-logging-tools.svg )
3
+ ![ GitHub] ( https://img.shields.io/github/license/imranMnts/react-native-logging-tools.svg )
4
+
1
5
# React Native Logging Tools
2
6
3
7
A react native module that lets you:
@@ -13,11 +17,12 @@ and all this, as easily as possible
13
17
- [ Usage] ( #usage )
14
18
- [ Imports] ( #imports )
15
19
- [ Initialization] ( #initialization )
16
- - [ How to use] ( #how-to-use )
17
- - [ Reactotron] ( #reactotron )
20
+ - [ Features] ( #features )
18
21
- [ Loggers] ( #loggers )
19
- - [ Events] ( #events )
20
- - [ Errors] ( #errors )
22
+ - [ Debug Events] ( #debug-events )
23
+ - [ Error Events] ( #error-events )
24
+ - [ Reactotron] ( #reactotron )
25
+ - [ JS Error handler] ( #js-error-handler )
21
26
22
27
---
23
28
39
44
|@react-native-firebase/crashlytics |:white_check_mark : | \> = 6.0.0
40
45
|@sentry/react-native |:white_check_mark : | \> = 1.3.0
41
46
|instabug-reactnative|:white_check_mark : | \> = 9.0.0
47
+ |@adobe/react-native-acpanalytics |:white_check_mark : | \> = 1.1.6
48
+ |@adobe/react-native-acpcore |:white_check_mark : | \> = 1.2.4
49
+ |tealium-react-native|:white_check_mark : | \> = 1.0.10
42
50
43
51
---
44
52
45
53
## Usage
46
54
47
55
### Imports
48
56
49
- To start, you have to import libraries which will be used.
57
+ To start, you have to import methods from ` react-native-logging-tools ` which will be used.
50
58
``` javascript
51
59
import {
52
60
init ,
53
61
createFirebaseLogger ,
54
62
createCrashlyticsLogger ,
55
63
createSentryLogger ,
64
+ createTealiumLogger ,
65
+ createAdobeLogger ,
56
66
setupReactotron ,
57
67
logEvent ,
58
68
} from ' react-native-logging-tools' ;
59
69
```
60
70
61
- And the others libraries which can be plugged
71
+ And the others external libraries to plug to ` react-native-logging-tools `
62
72
``` javascript
63
73
import Reactotron from ' reactotron-react-native' ;
64
74
import { reactotronRedux } from ' reactotron-redux' ;
@@ -67,62 +77,60 @@ import analytics from '@react-native-firebase/analytics';
67
77
import crashlytics from ' @react-native-firebase/crashlytics' ;
68
78
import * as Sentry from " @sentry/react-native" ;
69
79
import AsyncStorage from ' @react-native-community/async-storage' ;
80
+ import { ACPCore } from ' @adobe/react-native-acpcore' ;
70
81
```
71
82
72
83
### Initialization
73
84
74
- Before any call to ` react-native-logging-tools ` 's features, you have to initialize it (in your ` App.ts ` or ` store.ts ` for example )
85
+ Before any call to ` react-native-logging-tools ` 's features, you have to initialize it (eg. in your ` App.ts ` or ` store.ts ` )
75
86
76
87
``` javascript
77
88
init ({
78
89
config: {
79
- Reactotron,
80
- AsyncStorage,
81
90
reportJSErrors: ! __DEV__ ,
82
- isSensitiveBuild : __STORE__ },
83
- analytics: [createFirebaseLogger (analytics (), true )],
91
+ },
92
+ analytics: [createFirebaseLogger (analytics ())],
84
93
errorReporters: [createCrashlyticsLogger (crashlytics ())],
85
94
});
86
95
```
87
96
88
- Documentation and examples about initialization steps can be found [ here] ( ./REFERENCE_API.md ) .
97
+ : information_source : Documentation and example about initialization steps can be found [ here] ( ./REFERENCE_API.md ) .
89
98
90
- ### How to use
91
-
92
- #### Reactotron
93
-
94
- ``` javascript
95
- init ({
96
- config: { Reactotron },
97
- });
98
- ```
99
-
100
- Documentation and example about Reactotron can be found [ here] ( ./REFERENCE_API.md ) .
99
+ ### Features
101
100
102
101
#### Loggers
103
102
104
- ##### Events
103
+ ##### Debug Events
105
104
106
105
You can call this function where do you want/need to send logs to each plugged libraries to ` analytics ` during the initialization step
107
106
108
107
``` javascript
109
- logEvent (' EVENT_NAME' , { your_key: ' value' });
110
- logDebugEvent (' EVENT_NAME' , { your_key: ' value' });
111
- logErrorEvent (' EVENT_NAME' , { your_key: ' value' });
112
- logNetworkEvent (' EVENT_NAME' , { your_key: ' value' });
113
- logWarningEvent (' EVENT_NAME' , { your_key: ' value' });
108
+ logEvent (' EVENT_NAME' , { your_key: ' value' , ... });
109
+ logDebugEvent (' EVENT_NAME' , { your_key: ' value' , ... });
110
+ logWarningEvent (' EVENT_NAME' , { your_key: ' value' , ... });
111
+ logNetworkEvent (' EVENT_NAME' , { your_key: ' value' , ... });
112
+ logErrorEvent (' EVENT_NAME' , { your_key: ' value' , ... });
114
113
```
115
114
116
- Documentation and example about logging event can be found [ here] ( ./REFERENCE_API.md ) .
115
+ : information_source : Documentation and example about logging event can be found [ here] ( ./REFERENCE_API.md ) .
117
116
118
117
If you use ` react-navigation ` and you want send to analytics navigation events e.g, you can add ` logEvent ` to his event handler [ (React-navigation docs)] ( https://reactnavigation.org/docs/navigation-events/ )
119
118
120
- ##### Errors
119
+
120
+ ##### Error Events
121
121
122
122
You can call this function where do you want/need to send logs to each plugged libraries to ` errorReporters ` during the initialization step
123
123
124
124
``` javascript
125
- recordError (' EVENT_NAME' , { your_key: ' value' });
125
+ recordError (' EVENT_NAME' , { your_key: ' value' , ... });
126
126
```
127
127
128
- Documentation and example about error reporting can be found [ here] ( ./REFERENCE_API.md ) .
128
+ :information_source : Documentation and example about error reporting can be found [ here] ( ./REFERENCE_API.md ) .
129
+
130
+ #### Reactotron
131
+
132
+ :information_source : Documentation and example about Reactotron can be found [ here] ( ./REFERENCE_API.md ) .
133
+
134
+ #### JS Error handler
135
+
136
+ :information_source : Documentation and example about Reactotron can be found [ here] ( ./REFERENCE_API.md ) .
0 commit comments