Comments (6)
same issue.
Thanks to @callaars
This patch code works for me
diff --git a/node_modules/react-native-logs/src/index.ts b/node_modules/react-native-logs/src/index.ts
index 8b82148..0fc7c35 100644
--- a/node_modules/react-native-logs/src/index.ts
+++ b/node_modules/react-native-logs/src/index.ts
@@ -50,7 +50,7 @@ let stringifyFunc = (msg: any): string => {
} else {
try {
stringMsg =
- "\n" + JSON.stringify(msg, Object.getOwnPropertyNames(msg), 2) + "\n";
+ "\n" + JSON.stringify(msg, null, 2) + "\n";
} catch (error) {
stringMsg += "Undefined Message";
}
from react-native-logs.
I think this is done because otherwise the logs might be getting ridiculously long. You can patch it though if you want in src/index.ts:53
from react-native-logs.
Same issue here, example output:
LOG 13:35:15 | DEBUG : myAsyncNotificationReceivedHandler - Push Notification Content:
{
"body": "Test",
"data": {}, // **IN FACT, DATA DOES CONTAIN ELEMENTS**
"title": "Title",
"deeplinkUrl": "myapp://"
}
from react-native-logs.
from react-native-logs.
Wrapping the content inside JSON.stringify
works.
logger.info(JSON.stringify(message, null, 2));
from react-native-logs.
Related Issues (20)
- Log level always "LOG" for every severity on metro bundler for React native HOT 1
- fileAsyncTransport Error when using it from separate local package
- Typescript complaints about logger definition HOT 1
- I'm not able to generate and save(see) log in file manager (storage) of mobile device HOT 1
- how we can access log.txt file in iOS device HOT 5
- Queue? HOT 1
- Open to adding custom formatting support? HOT 2
- Sentry transporter seems to log always to error despite using info/debug.. HOT 2
- Is it possible to store file in Zip(compressed log.txt file) with in cache directory HOT 1
- NSMallocException - Expo device build fatal crash with FileAsyncTransport HOT 1
- Is there a way to pass types to transport function props? HOT 1
- today date formatting is incorrectly described in the docs HOT 1
- Logging to a log level with undefined transport causes app to crash HOT 2
- Using react-native-logs in a regular 'react' web app? HOT 2
- Date format with using {date-today} HOT 1
- use withScope to sentry's message logging?
- Logs cluttered with unformatted component trees
- Logs are not showing color on metro bundler for React native
- Request for a new feature HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-logs.