Skip to content

Commit b18bbf0

Browse files
authored
Feat/improvements (#11)
* IM-0 - readapt reactotron + bump version * IM-0 - cleaning * IM-0 - add tealium and adobbe * IM-0 - add travis and improve docs * IM-0 - imrove readme * IM-0 - add exclusion feature and update docs * IM-0 - clean * IM-0 - small clean * IM-0 - improve docs * IM-0 - improve docs * Update REFERENCE_API.md * Update README.md * IM-0 - upgrade package
1 parent 59b3aee commit b18bbf0

22 files changed

+1205
-1021
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: node_js
2+
node_js:
3+
- stable
4+
install:
5+
- yarn
6+
script:
7+
- yarn run test
8+
after_success:
9+
- npm run test:cov && bash <(curl -s https://codecov.io/bash) -e TRAVIS_NODE_VERSION

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
### Version 1.1.0
4+
5+
- News
6+
- Support Adobe and Tealium
7+
- Can exclude service by message type, if we don't want to send each message type to each service (eg. network error..)
8+
- Increase reactotron plugin's limit to 5
9+
- BugFixes
10+
- improve the support of typescript
11+
312
### Version 1.0.2
413

514
- BREAKING CHANGES

README.md

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
15
# React Native Logging Tools
26

37
A react native module that lets you:
@@ -13,11 +17,12 @@ and all this, as easily as possible
1317
- [Usage](#usage)
1418
- [Imports](#imports)
1519
- [Initialization](#initialization)
16-
- [How to use](#how-to-use)
17-
- [Reactotron](#reactotron)
20+
- [Features](#features)
1821
- [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)
2126

2227
---
2328

@@ -39,26 +44,31 @@ or
3944
|@react-native-firebase/crashlytics|:white_check_mark:| \>= 6.0.0
4045
|@sentry/react-native|:white_check_mark:| \>= 1.3.0
4146
|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
4250

4351
---
4452

4553
## Usage
4654

4755
### Imports
4856

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.
5058
```javascript
5159
import {
5260
init,
5361
createFirebaseLogger,
5462
createCrashlyticsLogger,
5563
createSentryLogger,
64+
createTealiumLogger,
65+
createAdobeLogger,
5666
setupReactotron,
5767
logEvent,
5868
} from 'react-native-logging-tools';
5969
```
6070

61-
And the others libraries which can be plugged
71+
And the others external libraries to plug to `react-native-logging-tools`
6272
```javascript
6373
import Reactotron from 'reactotron-react-native';
6474
import { reactotronRedux } from 'reactotron-redux';
@@ -67,62 +77,60 @@ import analytics from '@react-native-firebase/analytics';
6777
import crashlytics from '@react-native-firebase/crashlytics';
6878
import * as Sentry from "@sentry/react-native";
6979
import AsyncStorage from '@react-native-community/async-storage';
80+
import { ACPCore } from '@adobe/react-native-acpcore';
7081
```
7182

7283
### Initialization
7384

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`)
7586

7687
```javascript
7788
init({
7889
config: {
79-
Reactotron,
80-
AsyncStorage,
8190
reportJSErrors: !__DEV__,
82-
isSensitiveBuild: __STORE__ },
83-
analytics: [createFirebaseLogger(analytics(), true)],
91+
},
92+
analytics: [createFirebaseLogger(analytics())],
8493
errorReporters: [createCrashlyticsLogger(crashlytics())],
8594
});
8695
```
8796

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).
8998

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
101100

102101
#### Loggers
103102

104-
##### Events
103+
##### Debug Events
105104

106105
You can call this function where do you want/need to send logs to each plugged libraries to `analytics` during the initialization step
107106

108107
```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', ... });
114113
```
115114

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).
117116

118117
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/)
119118

120-
##### Errors
119+
120+
##### Error Events
121121

122122
You can call this function where do you want/need to send logs to each plugged libraries to `errorReporters` during the initialization step
123123

124124
```javascript
125-
recordError('EVENT_NAME', { your_key: 'value' });
125+
recordError('EVENT_NAME', { your_key: 'value', ... });
126126
```
127127

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

Comments
 (0)