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

Logs cluttered with unformatted component trees #94

Open
schaetz opened this issue Apr 16, 2024 · 1 comment
Open

Logs cluttered with unformatted component trees #94

schaetz opened this issue Apr 16, 2024 · 1 comment

Comments

@schaetz
Copy link

schaetz commented Apr 16, 2024

I have set up a pretty standard react-native-logs configuration for my React Native app. I am using mapConsoleTransport, so that the corresponding console method for the log levels is called and the log level is color-coded in the Metro console.

import { logger, mapConsoleTransport } from "react-native-logs";

const loggerConfig = {
  transport: mapConsoleTransport,
  levels: {
    trace: 0,
    debug: 1,
    info: 2,
    warn: 3,
    error: 4,
  },
  printLevel: true,
  severity: "trace",
};

var log = logger.createLogger<"trace" | "debug" | "info" | "warn" | "error">(
  loggerConfig,
);

export { log };

Unfortunately, my console is cluttered with junk, so that the significant logs are hard to find:

SceneView@http://192.168.X.XXX:8081/index.bundle//&platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.myapp:203353:22
RCTView
View
RCTView
View
RCTView
View

This doesn't happen if I remove the mapConsoleTransport, nor when I just use console.log.

It seems that these are component trees of the components in which the logs were added and they lack proper formatting. How can I remove them?

I could not find a lot information on this issue, so this seems to be a rare case; which is strange regarding that my config is pretty standard.

@alessandro-bottamedi
Copy link
Collaborator

Can you write a basic example?

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