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

console.log capturing starts not immediatelly #1422

Open
Bardiamist opened this issue Jan 25, 2024 · 1 comment
Open

console.log capturing starts not immediatelly #1422

Bardiamist opened this issue Jan 25, 2024 · 1 comment

Comments

@Bardiamist
Copy link

console.log capturing starts not immediatelly when no problems with Reactotron.log

In the next example console log 1 will not be printed in the Reactotron app when no problems with reactotron log 1.

Reactotron.configure({
  name: 'app',
})
  .useReactNative()
  .connect();

console.log('console log 1');
Reactotron.log('reactotron log 1');

setTimeout(() => {
  console.log('console log 2');
  Reactotron.log('reactotron log 2');
}, 1);

Repro here if need: https://github.com/Bardiamist/diff/tree/reactotron

Previously I used:

console.log = (...args) => {
  console.log(...args);
  Reactotron.log?.(...args);
};

Now it leads to double logs. Maybe you need to implement some override like this.

@LukasMod
Copy link

I noticed a similar problem. Logging at the very beginning of the application startup does not work with regular consol.log, with logging via Reactotron.log it works. Similarly, the first API requests are not captured. This behavior is very confusing if you want to analyze the start of the application. Can we somehow preinitialize reactotron and wait with the application until it starts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants