WP specific log handling

Even though setting WP to write in the debug.log is a piece of cake and displaying that log is not difficult either since Local is tailored to WP development.

This is what I currently do in all my setup:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );
define( 'SCRIPT_DEBUG', true );

Then, in a terminal, every time I sart working on the code, I type this: :> debug.log && tail -f debug.log.
That way I start with an empty log and I can keep an eye on anything written there.

All of this could be automated by Local.

It would be nice to have some feature to control and simplify this:

  • toggle DEBUG_LOG and control the other constants as explained above: changing this will make changes to the wp-config.php file
  • display the log “live”: this could be implemented inside the “Utilities” tab, or a new tab after it, which displays the content of the log pretty much as you do with the “tail” command. In fact, it could be as simple as a read-only terminal session which uses the tail command and provides a button to empty the log

I dig the idea!

Thanks for the suggestion :slight_smile: