Brings os_log to React Native: https://developer.apple.com/documentation/os/logging
Only the default log level is now supported – it's fine for debug purposes. The logs can be read in Console.app even when the app is not launched with debugger.
$ npm install react-native-os-logger --save
$ react-native link react-native-os-logger
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-os-loggerand addOsLogger.xcodeproj - In XCode, in the project navigator, select your project. Add
libOsLogger.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)<
import OsLogger from 'react-native-os-logger';
OsLogger.logDefault('LOG MESSAGE');