Can not using in React Native, even only log to console.
See original GitHub issueMay be React Native disabled ‘fs’ module, but I just log to console, no need for ‘fs’.
code:
/**
* Zai Qiu Chang App
* https://www.zaiqiuchang.com/
*/
import winston from 'winston';
import {debug} from './config';
export default new winston.Logger({
level: debug ? 'debug' : 'info',
transports: [
new winston.transports.Console()
]
});
import logger from './logger';
logger.debug("app");
error:
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
How to do logging in React Native - Stack Overflow
Select 'Debug JS' from your app on the device, and 'Toggle debug console(shift-command-y)' from your view menu on VS Code. You need github.com/ ......
Read more >Reviewing React Native console logs: Best practices
When anything goes wrong in an app, console.log() is the only statement we use to try and figure out what's wrong in our...
Read more >react-native-logs - npm
Performance-aware simple logger for React-Native with namespaces, custom levels and custom transports (colored console, file writing, etc.).
Read more >How To Use console.log() in React JS - Upmostly
Take the following React code: function Element() { //Code is OK const ...
Read more >Invalid Hook Call Warning - React
You might be using a version of react-dom (< 16.8.0) or react-native (< 0.59) that doesn't yet support Hooks. You can run npm...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @jaggerwang you can use
rn-nodeify
to hack the modules that are not present on React Native.For example in you
package.json
:I am getting following error when I try using winston in react native project