[Libwebsockets] Porting libwebsockets_set_log_callback to canonical libwebsockets

Andy Green andy at warmcat.com
Mon Oct 6 00:50:32 CEST 2014

On 6 October 2014 01:29:03 GMT+08:00, "Bartosz Gołaszewski" <bartekgola at gmail.com> wrote:
>there is a fork of libwebsockets at

I worked with David to empty everything useful from that back into canonical lws a year or so ago.  I think you find that fork is no longer maintained.

>It has a function - libwebsockets_set_log_callback - which allows user
>programs to intercept library log messages which is a very handy
>feature. Will a patch porting this function to upstream libwebsockets
>be accepted?

I already built in nice and flexible logging, you can set a function pointer using an api who is responsible to emit the logs.  For example, this is a built-in emit function that is exported to hook the logs to syslog


If you look in the test server, you can see the api used to set the emit function for logging


and the debug versosity level to emit at the same time.  This is enough to do anything you want with the logging including use it in your user code, add timestamps etc.


>Best regards,
>Bartosz Golaszewski
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org

More information about the Libwebsockets mailing list