react-native-logs icon indicating copy to clipboard operation
react-native-logs copied to clipboard

Logs cluttered with unformatted component trees

Open stefan-s29 opened this issue 1 year ago • 1 comments

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.

stefan-s29 avatar Apr 16 '24 12:04 stefan-s29

Can you write a basic example?

alessandro-bottamedi avatar Oct 17 '24 11:10 alessandro-bottamedi

reopen if necessary

alessandro-bottamedi avatar Sep 06 '25 16:09 alessandro-bottamedi