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.

Debug option at plugins

See original GitHub issue

Just an idea:

Currently the plugins have 4 lines of console log each if everything goes without any errors:

[SearchIndex] Compiling file public/wp-search.json
[SearchIndex] Successfully fetched posts from http://xxxxxxxxx/graphql
[SearchIndex] Created directory ./public
[SearchIndex] Successfully wrote file to public/wp-search.json

Making a total of 12 lines if all plugins are passed. I was thinking that maybe is a good idea to just log 1 line (per plugin) if everthing goes as supossed, something like: Successfully created: wp-search.json.

In order to not lose all the useful console logs, we can grab a new boolean variable debug at each plugin:

const { env, outputDirectory, outputName, debug = false } = nextConfig;

And set all console logs with an && operator based on that debug variable.

debug && console.log('....')

Like so, by default only one line is logged (a new final log added after plugin.postcreate, not conditional). The errors will still work as they are handle as throw new Error. Also in case is needed, we can pass the variable debug = true at next.config.js and activate all the logs accross the code.

shot

What do you think?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
colbyfayockcommented, Nov 30, 2020

yup sounds great, thanks

0reactions
GuilleAngulocommented, Nov 29, 2020

Exactly. I can take care of this one if you like the idea

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging in WordPress – WordPress.org Forums
There are many debugging plugins for WordPress that show more information about the internals, either for a specific component or in general. Here...
Read more >
How to Enable Debugging in WordPress (Debug Mode)
Method 1 – Enable Debugging using a plugin​​ Step 5 – Navigate to the Dashboard > Tools > WP Debugging; Step 6 –...
Read more >
How to Enable WordPress Debug Mode (2 Methods)
Method 1: Enable WordPress Debug Mode With a Plugin. This method will suit users who'd rather not mess with their website's PHP code...
Read more >
A Complete Guide to WordPress Debugging (Enable ... - Kinsta
In this post, we'll dig into the built-in WordPress debug mode and show you how to enable ... The settings are for the...
Read more >
Tutorial: Debug a plug-in (Microsoft Dataverse) - Power Apps
Debug your plug-in · In the Replay Plug-in Execution dialog, on the Setup tab, in the Specify Assembly section, click the ellipses (…)...
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