8000 feat: simpler LoggerLink for react native and other terminal console environments · Issue #6097 · trpc/trpc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: simpler LoggerLink for react native and other terminal console environments #6097

Open
1 task done
capaj opened this issue Oct 10, 2024 · 1 comment
Open
1 task done
Labels
✅ accepted-PRs-welcome Feature proposal is accepted and ready to work on 💰 wontfix/$$$$ Can be worked on, but needs to be a paid, feel free to contact sales@trpc.io if you want priority

Comments

@capaj
Copy link
capaj commented Oct 10, 2024

Describe the feature you'd like to request

react native console cannot print out the object as nicely as browser console, so it's not usable as it is. For example a single log looks like this:

 LOG   << query #6 myQuery '{"context": {"lowPriority": true}, "elapsedMs": 1878, "input": undefined, "result": {"context": {"response": [Object], "responseJSON": [Array]}, "result": {"data": [Array], "type": "data"}}}'

I can't even see the data because it's just represented as string [Array]

Describe the solution you'd like to see

a simpler logging link which would only print out inputs and outputs in json, ideally colorized

Describe alternate solutions

not sure

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR implementing this feature!

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar
@KATT KATT added ✅ accepted-PRs-welcome Feature proposal is accepted and ready to work on 💰 wontfix/$$$$ Can be worked on, but needs to be a paid, feel free to contact sales@trpc.io if you want priority labels Oct 10, 2024
@KATT
Copy link
Member
KATT commented Jan 26, 2025

FWIW, you can look at the sourcecode of loggerLink, main thing you need to implement your own is to tap() the observables

return next(op)
.pipe(
tap({
next(result) {
logResult(result);
},
error(result) {
logResult(result);
},
}),
)
.subscribe(observer);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ accepted-PRs-welcome Feature proposal is accepted and ready to work on 💰 wontfix/$$$$ Can be worked on, but needs to be a paid, feel free to contact sales@trpc.io if you want priority
Projects
None yet
Development

No branches or pull requests

2 participants
0