Skip to content

Debugging and Logging

Q edited this page Aug 17, 2020 · 9 revisions

WP_Debug must be set to true in order to write to log file and the plugin static 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 has its own dedicated debug file, called willow.log, which is located in the root or the wp-contents directory.

Enable Global Debugging

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

// return an array ##
return [ 'global' 			=> [

	'config'				=> [
		
		// run context->task ##
		'run' 				=> true,
		
		// context->task debugging ##
		'debug'				=> false,

		// by default, willow should echo values
		'return'       	 	=> 'echo'

	],

]];

Enable Context Debugging

Enable Debugging per Willow

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

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

Clone this wiki locally