Skip to content

Commit

Permalink
chore: add instruction for collecting logs
Browse files Browse the repository at this point in the history
  • Loading branch information
intent-kacper-cyranowski committed Jul 9, 2024
1 parent 3ea5449 commit 8310677
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ It does NOT support:
- bluetooth classic devices.
- communicating between phones using BLE (Peripheral support)
- [bonding peripherals](https://github.com/dotintent/react-native-ble-plx/wiki/Device-Bonding)
- [beacons](https://github.com/dotintent/react-native-ble-plx/wiki/=-FAQ:-Beacons)

## Table of Contents

Expand All @@ -43,7 +44,7 @@ For old RN versions (<0.60) please check [old README](./docs/README_V1.md) (1.x)
for the old instructions or [migration guide](./docs/MIGRATION_V1.md).

| React Native | 3.1.2 |
|--------------| ------------------ |
| ------------ | ------------------ |
| 0.74.1 | :white_check_mark: |
| 0.69.6 | :white_check_mark: |
| Expo 51 | :white_check_mark: |
Expand Down
16 changes: 16 additions & 0 deletions docs/TUTORIALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,19 @@ bleManagerInstance
console.error('Get connected devices error:', error)
})
```

### Collecting native logs

If you encounter any issues with the library, you can enable native logs to get more information about what is happening under the hood. To enable native logs, you need to set the `logLevel` property on the BleManager instance to `LogLevel.Verbose`.

```js
bleManagerInstance.setLogLevel(LogLevel.Verbose)
```

#### Android

To collect native logs on Android, you can open the Logcat in Android Studio and set filters to `package:mine (tag:BluetoothGatt | tag:ReactNativeJS | RxBle)`

#### iOS

To collect native logs on iOS, you can open the Xcode console.
7 changes: 7 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,13 @@ <h3>Connecting to a device that is already connected to the OS</h3>
.catch(<span class="hljs-function"><span class="hljs-params">error</span> =&gt;</span> {
<span class="hljs-built_in">console</span>.error(<span class="hljs-string">'Get connected devices error:'</span>, error)
})</pre>
<h3>Collecting native logs</h3>
<p>If you encounter any issues with the library, you can enable native logs to get more information about what is happening under the hood. To enable native logs, you need to set the <code>logLevel</code> property on the BleManager instance to <code>LogLevel.Verbose</code>.</p>
<pre class='hljs'>bleManagerInstance.setLogLevel(LogLevel.Verbose)</pre>
<h4>Android</h4>
<p>To collect native logs on Android, you can open the Logcat in Android Studio and set filters to <code>package:mine (tag:BluetoothGatt | tag:ReactNativeJS | RxBle)</code>.</p>
<h4>iOS</h4>
<p>To collect native logs on iOS, you can open the Xcode console.</p>


</section></div>
Expand Down

0 comments on commit 8310677

Please sign in to comment.