'

MKP Base Use Custom Handler Function

You can use your own diagnostic message handler by creating a function that takes a message string as it’s sole argument. This is a bit tricky, so it’s a good idea to clear the diagnostics before resetting the option values and then show and clear it afterwards.

mkp_base clear_diagnostics
mkp_base verbose option=function set_option
mkp_base show_diagnostics clear_diagnostics

Output:


MKP Plugins: Setting Option verbose = [true]

MKP Plugins: Setting Option option = [function]


Diagnostic Logfile Contents

Logfile: /nas/content/live/mkpusaws/wp-content/MKP Plugins_29.log

10/23/19 05:10:49->MKP Plugins: Logfile [/nas/content/live/mkpusaws/wp-content/MKP Plugins_29.log] cleared
10/23/19 05:10:49->MKP Plugins: Getting name=[verbose] code=[verbose] value=[true]
10/23/19 05:10:49->MKP Plugins: Getting name=[option] code=[option] value=[function]
10/23/19 05:10:49->MKP Plugins: Getting name=[set_option] code=[set_option] value=[true]
10/23/19 05:10:49->MKP Plugins: Doing code=[verbose] name=[verbose] value=[true]
10/23/19 05:10:49->MKP Plugins: Doing code=[option] name=[option] value=[function]
10/23/19 05:10:49->MKP Plugins: Doing code=[set_option] name=[set_option] value=[true]
10/23/19 05:10:49->MKP Plugins: Setting Option verbose = [true]
10/23/19 05:10:49->MKP Plugins: Setting Option option = [function]
10/23/19 05:10:49->MKP Plugins: Getting name=[show_diagnostics] code=[show_diagnostics] value=[true]
10/23/19 05:10:49->MKP Plugins: Getting name=[clear_diagnostics] code=[clear_diagnostics] value=[true]
10/23/19 05:10:49->MKP Plugins: Doing code=[show_diagnostics] name=[show_diagnostics] value=[true]