I am trying to use winston in my react-native app for logging errors and other things in runtime. But after installing winston it gives me following error
`Unable to resolve module crypto
Unable to resolve module cycle
Unable to resolve module fs`
Is winston even compatible with react-native?
Winston is the most popular logging library for Node. js. It aims to make logging more flexible and extensible by decoupling different aspects such as log levels, formatting, and storage so that each API is independent and many combinations are supported. It also uses Node.
Note that as of React Native 0.29 and later, you can get logs without running the debugger. Just run react-native log-ios or react-native log-android on the command line inside your project folder. And when you open the Remote JS Debugging, you have to press option+command+i and check the console.
const winston = require('winston'); // ... winston. level = 'debug'; will set the log level to 'debug'.
So, I found out that winston is not supported in react native. So, now i have implemented a customised logging system.
Answered this so that no one wastes there time with winston if working on react native
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With