Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JessicaYeh/react-native-native-log
A React Native log function that under the hood calls NSLog() on iOS and Log.i() on Android
https://github.com/JessicaYeh/react-native-native-log
Last synced: about 2 months ago
JSON representation
A React Native log function that under the hood calls NSLog() on iOS and Log.i() on Android
- Host: GitHub
- URL: https://github.com/JessicaYeh/react-native-native-log
- Owner: JessicaYeh
- License: mit
- Created: 2020-07-24T18:24:24.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T12:22:30.000Z (about 2 years ago)
- Last Synced: 2024-04-29T16:42:08.253Z (9 months ago)
- Language: Java
- Size: 4.03 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - react-native-native-log ★0 - A React Native log function that under the hood calls native logs. (Components / Utils & Infra)
- awesome-react-native - react-native-native-log ★0 - A React Native log function that under the hood calls native logs. (Components / Utils & Infra)
README
# react-native-native-log
A React Native log function that under the hood calls NSLog() on iOS and Log.i() on Android.
A potential use case for this library is to be able to read logs with an E2E UI testing tool like Appium.
## Installation
```sh
npm install react-native-native-log
```## Usage
```js
import NativeLog from "react-native-native-log";// ...
NativeLog.log('hello world'); // hello world
// or
NativeLog.logWithTag('my-tag', 'hello world'); // [my-tag] hello world
```## Example app
To get started with the project, run `yarn bootstrap` in the root directory to install the required dependencies for each package:
```sh
yarn bootstrap
```### iOS
To run the example app on iOS:
```sh
yarn example ios
```In order to see the native logs (they won't show in the normal console log in the Metro window):
- Run the iOS app from example/ios/NativeLogExample.xcworkspace in Xcode and look at the log window there### Android
To run the example app on Android:
```sh
yarn example android
```In order to see the native logs (they won't show in the normal console log in the Metro window):
- run `adb logcat`## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
MIT