question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simple render logger?

See original GitHub issue

Hi Vitali!

I really like WhyDidYouRender and want to thank you one more time, от души!

How difficult it would be to create a logger for printing component names being rendered? Without any options (except for on/off), just simple names printing. In my understanding it’s just a minor part of WDYR.

Currently we have to leave console.log("ComponentName render") or like in every component and optionally wrap it into if (process.env.NODE_ENV === "development") {...}-s. But going WYDR way, we could have just a single initialization call in the index.js and then get logging enabled for every component.

I think such a tool would be very helpful.

P.S. Let’s imagine what it could have looked like:

if (process.env.NODE_ENV === "development") {
  const renderLogger = require("@welldone-software/render-logger");
  renderLogger(React, {
    enabled: true
  });
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16

github_iconTop GitHub Comments

1reaction
vzaidmancommented, Apr 24, 2020

hey!

take a look at this fixed version: https://codesandbox.io/s/wdyr-simple-logger-11-fix-p3ilj

I updated the readme yesterday to eliminate these edge cases: https://github.com/welldone-software/why-did-you-render#installation

the difference is that wdyr should be applies before elements are created, including App.

1reaction
OnkelTemcommented, Apr 23, 2020

Thanks! Let me try. If/when I succeed I’ll come up with an example sandbox and a snippet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

logging and rendering a table · Discussion #1799 - GitHub
Now I am trying have a rich.table rendered in a log entry with the ... logging is not designed for anything other that...
Read more >
Logging renders? - Blender Stack Exchange
Is there a simple way to log/save every render that you make in a Blender scene? Maybe an add-on? This would be helpful...
Read more >
Logging Cookbook — Python 3.11.1 documentation
A simple web application which performs logging via a socket connected to the ... have logging messages rendered in an audible rather than...
Read more >
Configuring Logging - Quarkus
Render the time in milliseconds since the start of the application log. %s. Simple message. Renders just the log message, with no exception...
Read more >
layout_json: Generate log layout function rendering JSON
Generate log layout function rendering JSON. ... of a Log Record Introduction to logger Logging from R Packages Migration Guide Simple Benchmarks on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found