1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

lwsl_visible

This commit is contained in:
Andy Green 2017-02-09 09:11:17 +08:00
parent 388f6c97fb
commit c8b20910ec
2 changed files with 17 additions and 0 deletions

View file

@ -1244,6 +1244,11 @@ LWS_VISIBLE void lws_set_log_level(int level,
lwsl_emit = func;
}
LWS_VISIBLE int lwsl_visible(int level)
{
return log_level & level;
}
LWS_VISIBLE int
lws_is_ssl(struct lws *wsi)
{

View file

@ -385,6 +385,18 @@ lws_set_log_level(int level,
LWS_VISIBLE LWS_EXTERN void
lwsl_emit_syslog(int level, const char *line);
/**
* lwsl_visible() - returns true if the log level should be printed
*
* \param level: one of LLL_ log level indexes
*
* This is useful if you have to do work to generate the log content, you
* can skip the work if the log level used to print it is not actually
* enabled at runtime.
*/
LWS_VISIBLE LWS_EXTERN int
lwsl_visible(int level);
///@}