introduce logging api and convert all library output to use it

 - multiple debug context calls lwsl_ err, warn, debug, parser, ext, client

 - api added to set which contexts output to stderr using a bitfield log_level

 - --disable-debug on configure removes all code that is not err or warn severity

 - err and warn contexts always output to stderr unless disabled by log_level

 - err and warn enabled by default in log_level

Signed-off-by: Andy Green <andy@warmcat.com>
diff --git a/libwebsockets-api-doc.html b/libwebsockets-api-doc.html
index 5f245bb..b41b4c7 100644
--- a/libwebsockets-api-doc.html
+++ b/libwebsockets-api-doc.html
@@ -350,6 +350,21 @@
 "just work".
 </blockquote>
 <hr>
+<h2>lws_set_log_level - Set the logging bitfield</h2>
+<i>void</i>
+<b>lws_set_log_level</b>
+(<i>int</i> <b>level</b>)
+<h3>Arguments</h3>
+<dl>
+<dt><b>level</b>
+<dd>OR together the LLL_ debug contexts you want output from
+</dl>
+<h3>Description</h3>
+<blockquote>
+<p>
+defaults to err and warn contexts enabled
+</blockquote>
+<hr>
 <h2>libwebsocket_write - Apply protocol then write data to client</h2>
 <i>int</i>
 <b>libwebsocket_write</b>