Willow

Debugging and Logging

Willow has its own dedicated debug file, called willow.log, which is located in the root or the wp-contents directory.
Version 1.4.8
Latest Changes:

* New: html_entity_decode filter


Documentation about each release is updated as often as possible, but may lag behind the Master Branch or other generated documentation.

Featured Work
Quinta de Sant’Ana, Portugal
Quinta de Sant’Ana, Portugal

Quinta de Sant'Ana overlooks the picturesque village of Gradil with its cobbled streets, white washed houses and hospitable inhabitants.


Overview

The WP_Debug constant must be set to true in the wp_config.php application in order to write to the log file and the Willow plugin static class property $debug OR an external debug control must be set to true + debugging is controlled either on a context, context + task level or directly via template config->debug = true setting

Willow writes to the standard WordPress debug file, called debug.log, which is located in the root or the wp-contents directory.


Global Debugging

Willow load a global context file, located at library/willow/global.php – this includes top level settings, as follows:

As this file is located in the Q Willow plugin, it is not advised to change this directly, instead create a matching file in your own WP Theme and place it is the same logical position – that is library/willow/global.php from the root folder of the active parent or child theme – there is no need to include this file directly, Willow should find it.

This is also possible from a plugin, if it has been registered correctly with Willow – Read more


Context or Task Debugging

As with global configuration, each context can also have a configuration file to define context level settings, this can be placed in the same location as the global.js, but named according to the context – some examples are:

  • ui.php control how ui context->tasks behave
  • post.php define settings for post tasks
  • module~search.php control settings for a specific task within the module context

In theory, all configuration could sit with one single, large, configuration file, but this quickly becomes unmanageable and less portable – so Willow both allows and encourages the creation of global, context and context+task specific files.

Within any of the configuration files listed above we can place any or all of the configuration options from global.php, re-defining the settings we need at a more granular level.

Note the naming convention of the files follows exactly the template usage – see this example:

{~ module~search ~} would load it’s configuration from module~search.php – with all the logic of fallbacks, priority and configuration merging taken into account.


Inline Debugging

In the following example, we are enabling debugging for the called Willow:

{~ group~frontpage_work{+ [array] 
	config = debug: true & 
	config->post = {% [return] get_site_option{+ page_on_front +} %} 
+} ~}

The result of this configuration setting will be to include a new key frontpage_work in the debug output, which will include all recorded events in the processing of the function data and output.


Notes

  • Many aspects of how the debugging process works can be controlled via filters, from the file location to the default log keys to include – in order to understand better how this works, please via the code