<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>verboserpc (third party plugin)</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="../../style.css" type="text/css" /> <link rel="stylesheet" href="../../local.css" type="text/css" /> <meta name="author" content="spalax" /> </head> <body> <div class="page"> <div class="pageheader"> <div class="header"> <span> <span class="parentlinks"> <a href="../../index.html">ikiwiki</a>/ <a href="../../plugins.html">plugins</a>/ <a href="../contrib.html">contrib</a>/ </span> <span class="title"> verboserpc (third party plugin) </span> </span> </div> </div> <div id="pagebody"> <div id="content" role="main"> <p><span class="infobox"> Plugin: verboserpc<br /> Author: <span class="createlink">Louis</span><br /> Included in ikiwiki: no<br /> Enabled by default: no<br /> Included in <a href="../goodstuff.html">goodstuff</a>: no<br /> Currently enabled: no<br /> </span></p> <p>Debugging <a href="//ikiwiki.info/plugins/write/external/">external plugins</a> is a pain, as soon as RPC is involved… This kind-of plugin tries to make it a little bit less painful.</p> <p>It acts as a proxy between Ikiwiki and the plugin (which, for the record, is an executable program communicating with Ikiwiki using <a href="http://www.xmlrpc.com/">XML RPC</a> on standard input/output), and logs everithing on standard error.</p> <div class="toc"> <ol> <li class="L1"><a href="#index1h1">Example</a> </li> <li class="L1"><a href="#index2h1">Enabling the plugin</a> </li> <li class="L1"><a href="#index3h1">Does it work?</a> </li> <li class="L1"><a href="#index4h1">Download and install</a> </li> </ol> </div> <h1><a name="index1h1"></a>Example</h1> <p>A sample output of a wiki compilation is shown below.</p> <pre><code>$ ikiwiki --setup wiki.setup --refresh --verbose -> <?xml version="1.0" encoding="utf-8"?><methodCall><methodName>import</methodName><params></params></methodCall> <- <?xml version='1.0'?> <- <methodCall> <- <methodName>hook</methodName> <- <params> <- <param> <- <value><string>call</string></value> <- </param> <- <param> <- <value><string>getsetup</string></value> <- </param> <- <param> <- <value><string>type</string></value> <- </param> <- <param> <- <value><string>getsetup</string></value> <- </param> <- <param> <- <value><string>id</string></value> <- </param> <- <param> <- <value><string>foo</string></value> <- </param> <- <param> <- <value><string>last</string></value> <- </param> <- <param> <- <value><boolean>0</boolean></value> <- </param> <- </params> <- </methodCall> -> <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><string>1</string></value></param></params></methodResponse> <- <?xml version='1.0'?> <- <methodResponse> <- <params> <- <param> <- <value><struct> <- <member> <- <name>null</name> <- <value><string></string></value> <- </member> <- </struct></value> <- </param> <- </params> <- </methodResponse> rebuilding wiki.. scanning index.mdwn building index.mdwn done </code></pre> <h1><a name="index2h1"></a>Enabling the plugin</h1> <p>Let us say you want to debug a plugin <code>foo</code>, located somewhere in your <a href="https://ikiwiki.info/plugins/install/"><code>libdir</code></a>.</p> <ol> <li>Do not not enable plugin <code>foo</code> in the ikiwiki setup file.</li> <li>Create a symbolic link named <code>foo.verboserpc</code> in one of your <code>libdir</code>, linking to the <code>verboserpc</code> plugin.</li> <li>In your setup file, enable plugin <code>foo.verboserpc</code>.</li> </ol> <p>That's it. When called, the <code>verboserpc</code> plugin will be called as <code>foo.verboserpc</code>, and will run program <code>foo</code>, while transmitting (to Ikiwiki and <code>foo</code>) and logging (to standard error) any input/output.</p> <h1><a name="index3h1"></a>Does it work?</h1> <p>Well… External plugins are still a pain to debug, even with this tool. If your plugin is written using python, and you are using the <a href="http://source.ikiwiki.branchable.com/?p=source.git;a=blob;f=plugins/proxy.py;h=b61eb466c8d47ef839fc24e5d0ba54be3a9b23fa;hb=HEAD"><code>proxy</code></a>, it might be useless, since this proxy already have an option to log RPC calls (by giving <code>debug_fn=sys.stderr.write</code> as an option to the constructor of <a href="http://source.ikiwiki.branchable.com/?p=source.git;a=blob;f=plugins/proxy.py;h=b61eb466c8d47ef839fc24e5d0ba54be3a9b23fa;hb=HEAD#l217"><code>IkiWikiProcedureProxy</code></a>).</p> <p>I am not sure that this plugin is the solution to the problem of debugging external plugins. I am still publishing it here, hoping that someone might improve it into something useful…</p> <h1><a name="index4h1"></a>Download and install</h1> <p>Code and documentation can be found here : <a href="https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/VerboseRPC">https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/VerboseRPC</a>.</p> </div> </div> <div id="footer" class="pagefooter" role="contentinfo"> <div id="pageinfo"> <div class="pagedate"> Last edited <span class="date">Tue Feb 26 23:01:54 2019</span> <!-- Created <span class="date">Tue Feb 26 23:01:54 2019</span> --> </div> </div> <!-- from ikiwiki --> </div> </div> </body> </html>