2016-06-20 17:05:31 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=9" / >
2017-03-20 19:37:47 +08:00
< meta name = "generator" content = "Doxygen 1.8.13" / >
2017-02-05 22:46:39 +08:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
2016-06-20 17:05:31 +08:00
< title > libwebsockets: Logging< / title >
< link href = "tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "jquery.js" > < / script >
< script type = "text/javascript" src = "dynsections.js" > < / script >
< link href = "navtree.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "resize.js" > < / script >
< script type = "text/javascript" src = "navtreedata.js" > < / script >
< script type = "text/javascript" src = "navtree.js" > < / script >
< script type = "text/javascript" >
$(document).ready(initResizable);
< / script >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr style = "height: 56px;" >
< td id = "projectlogo" > < img alt = "Logo" src = "libwebsockets.org-logo.png" / > < / td >
< td id = "projectalign" style = "padding-left: 0.5em;" >
< div id = "projectname" > libwebsockets
< / div >
< div id = "projectbrief" > Lightweight C library for HTML5 websockets< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
2017-03-20 19:37:47 +08:00
<!-- Generated by Doxygen 1.8.13 -->
2017-02-05 22:46:39 +08:00
< script type = "text/javascript" src = "menudata.js" > < / script >
< script type = "text/javascript" src = "menu.js" > < / script >
< script type = "text/javascript" >
$(function() {
initMenu('',false,false,'search.php','Search');
});
< / script >
< div id = "main-nav" > < / div >
2016-06-20 17:05:31 +08:00
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
< div id = "splitbar" style = "-moz-user-select:none;"
class="ui-resizable-handle">
< / div >
< / div >
< script type = "text/javascript" >
$(document).ready(function(){initNavTree('group__log.html','');});
< / script >
< div id = "doc-content" >
< div class = "header" >
< div class = "summary" >
< a href = "#enum-members" > Enumerations< / a > |
< a href = "#func-members" > Functions< / a > < / div >
< div class = "headertitle" >
< div class = "title" > Logging< / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "enum-members" > < / a >
Enumerations< / h2 > < / td > < / tr >
2017-02-05 22:46:39 +08:00
< tr class = "memitem:ga14542b84d2c76efa7814124bb10f9c5f" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "ga14542b84d2c76efa7814124bb10f9c5f" > < / a > enum   < / td > < td class = "memItemRight" valign = "bottom" > < b > lws_log_levels< / b > { < br / >
2016-06-20 17:05:31 +08:00
    < b > LLL_ERR< / b > = 1 < < 0,
< b > LLL_WARN< / b > = 1 < < 1,
< b > LLL_NOTICE< / b > = 1 < < 2,
< b > LLL_INFO< / b > = 1 < < 3,
< br / >
    < b > LLL_DEBUG< / b > = 1 < < 4,
< b > LLL_PARSER< / b > = 1 < < 5,
< b > LLL_HEADER< / b > = 1 < < 6,
< b > LLL_EXT< / b > = 1 < < 7,
< br / >
    < b > LLL_CLIENT< / b > = 1 < < 8,
< b > LLL_LATENCY< / b > = 1 < < 9,
< b > LLL_COUNT< / b > = 10
< br / >
}< / td > < / tr >
< tr class = "separator:ga14542b84d2c76efa7814124bb10f9c5f" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "func-members" > < / a >
Functions< / h2 > < / td > < / tr >
2017-02-05 22:46:39 +08:00
< tr class = "memitem:ga0cdc1065ae7f003d59a3c8525acf545e" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "ga0cdc1065ae7f003d59a3c8525acf545e" > < / a >
LWS_VISIBLE LWS_EXTERN void  < / td > < td class = "memItemRight" valign = "bottom" > < b > _lws_log< / b > (int filter, const char *format,...) LWS_FORMAT(2)< / td > < / tr >
< tr class = "separator:ga0cdc1065ae7f003d59a3c8525acf545e" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga74eb146969f0595e12ea835851b4588e" > < td class = "memItemLeft" align = "right" valign = "top" > < a id = "ga74eb146969f0595e12ea835851b4588e" > < / a >
2016-06-20 17:05:31 +08:00
LWS_VISIBLE LWS_EXTERN void  < / td > < td class = "memItemRight" valign = "bottom" > < b > _lws_logv< / b > (int filter, const char *format, va_list vl)< / td > < / tr >
< tr class = "separator:ga74eb146969f0595e12ea835851b4588e" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga42e39775c6b69b7251bdbf5a2cdd5dcd" > < td class = "memItemLeft" align = "right" valign = "top" > LWS_VISIBLE LWS_EXTERN int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__log.html#ga42e39775c6b69b7251bdbf5a2cdd5dcd" > lwsl_timestamp< / a > (int level, char *p, int len)< / td > < / tr >
< tr class = "separator:ga42e39775c6b69b7251bdbf5a2cdd5dcd" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga898b1f03872ad019f507d4e35bbefa90" > < td class = "memItemLeft" align = "right" valign = "top" > LWS_VISIBLE LWS_EXTERN void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__log.html#ga898b1f03872ad019f507d4e35bbefa90" > lwsl_hexdump< / a > (void *buf, size_t len)< / td > < / tr >
< tr class = "separator:ga898b1f03872ad019f507d4e35bbefa90" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ga244647f9e1bf0097ccdde66d74f41e26" > < td class = "memItemLeft" align = "right" valign = "top" > LWS_VISIBLE LWS_EXTERN void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__log.html#ga244647f9e1bf0097ccdde66d74f41e26" > lws_set_log_level< / a > (int level, void(*log_emit_function)(int level, const char *line))< / td > < / tr >
< tr class = "separator:ga244647f9e1bf0097ccdde66d74f41e26" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gab7c0fc936cc9f1eb58e2bb234c15147c" > < td class = "memItemLeft" align = "right" valign = "top" > LWS_VISIBLE LWS_EXTERN void  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__log.html#gab7c0fc936cc9f1eb58e2bb234c15147c" > lwsl_emit_syslog< / a > (int level, const char *line)< / td > < / tr >
< tr class = "separator:gab7c0fc936cc9f1eb58e2bb234c15147c" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
< h2 > Logging< / h2 >
< p > Lws provides flexible and filterable logging facilities, which can be used inside lws and in user code.< / p >
< p > Log categories may be individually filtered bitwise, and directed to built-in sinks for syslog-compatible logging, or a user-defined function. < / p >
< h2 class = "groupheader" > Function Documentation< / h2 >
2017-02-05 22:46:39 +08:00
< a id = "ga244647f9e1bf0097ccdde66d74f41e26" > < / a >
2017-03-20 19:37:47 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ga244647f9e1bf0097ccdde66d74f41e26" > ◆ < / a > < / span > lws_set_log_level()< / h2 >
2017-02-05 22:46:39 +08:00
2016-06-20 17:05:31 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > LWS_VISIBLE LWS_EXTERN void lws_set_log_level < / td >
< td > (< / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > level< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > void(*)(int level, const char *line)  < / td >
< td class = "paramname" > < em > log_emit_function< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > < code > #include < < a class = "el" href = "libwebsockets_8h.html" > lib/libwebsockets.h< / a > > < / code > < / p >
< p > < a class = "el" href = "group__log.html#ga244647f9e1bf0097ccdde66d74f41e26" > lws_set_log_level()< / a > - Set the logging bitfield < / p > < dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > level< / td > < td > OR together the LLL_ debug contexts you want output from < / td > < / tr >
< tr > < td class = "paramname" > log_emit_function< / td > < td > NULL to leave it as it is, or a user-supplied function to perform log string emission instead of the default stderr one.< / td > < / tr >
< / table >
< / dd >
< / dl >
< p > log level defaults to "err", "warn" and "notice" contexts enabled and emission on stderr. < / p >
< / div >
< / div >
2017-02-05 22:46:39 +08:00
< a id = "gab7c0fc936cc9f1eb58e2bb234c15147c" > < / a >
2017-03-20 19:37:47 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#gab7c0fc936cc9f1eb58e2bb234c15147c" > ◆ < / a > < / span > lwsl_emit_syslog()< / h2 >
2017-02-05 22:46:39 +08:00
2016-06-20 17:05:31 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > LWS_VISIBLE LWS_EXTERN void lwsl_emit_syslog < / td >
< td > (< / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > level< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const char *  < / td >
< td class = "paramname" > < em > line< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > < code > #include < < a class = "el" href = "libwebsockets_8h.html" > lib/libwebsockets.h< / a > > < / code > < / p >
< p > < a class = "el" href = "group__log.html#gab7c0fc936cc9f1eb58e2bb234c15147c" > lwsl_emit_syslog()< / a > - helper log emit function writes to system log< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > level< / td > < td > one of LLL_ log level indexes < / td > < / tr >
< tr > < td class = "paramname" > line< / td > < td > log string< / td > < / tr >
< / table >
< / dd >
< / dl >
< p > You use this by passing the function pointer to < a class = "el" href = "group__log.html#ga244647f9e1bf0097ccdde66d74f41e26" > lws_set_log_level()< / a > , to set it as the log emit function, it is not called directly. < / p >
< / div >
< / div >
2017-02-05 22:46:39 +08:00
< a id = "ga898b1f03872ad019f507d4e35bbefa90" > < / a >
2017-03-20 19:37:47 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ga898b1f03872ad019f507d4e35bbefa90" > ◆ < / a > < / span > lwsl_hexdump()< / h2 >
2017-02-05 22:46:39 +08:00
2016-06-20 17:05:31 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > LWS_VISIBLE LWS_EXTERN void lwsl_hexdump < / td >
< td > (< / td >
< td class = "paramtype" > void *  < / td >
< td class = "paramname" > < em > buf< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > size_t  < / td >
< td class = "paramname" > < em > len< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > < code > #include < < a class = "el" href = "libwebsockets_8h.html" > lib/libwebsockets.h< / a > > < / code > < / p >
< p > < a class = "el" href = "group__log.html#ga898b1f03872ad019f507d4e35bbefa90" > lwsl_hexdump()< / a > - helper to hexdump a buffer (DEBUG builds only)< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > buf< / td > < td > buffer start to dump < / td > < / tr >
< tr > < td class = "paramname" > len< / td > < td > length of buffer to dump < / td > < / tr >
< / table >
< / dd >
< / dl >
< / div >
< / div >
2017-02-05 22:46:39 +08:00
< a id = "ga42e39775c6b69b7251bdbf5a2cdd5dcd" > < / a >
2017-03-20 19:37:47 +08:00
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ga42e39775c6b69b7251bdbf5a2cdd5dcd" > ◆ < / a > < / span > lwsl_timestamp()< / h2 >
2017-02-05 22:46:39 +08:00
2016-06-20 17:05:31 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > LWS_VISIBLE LWS_EXTERN int lwsl_timestamp < / td >
< td > (< / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > level< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > char *  < / td >
< td class = "paramname" > < em > p< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > len< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > < code > #include < < a class = "el" href = "libwebsockets_8h.html" > lib/libwebsockets.h< / a > > < / code > < / p >
< p > lwsl_timestamp: generate logging timestamp string< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > level< / td > < td > logging level < / td > < / tr >
< tr > < td class = "paramname" > p< / td > < td > char * buffer to take timestamp < / td > < / tr >
< tr > < td class = "paramname" > len< / td > < td > length of p< / td > < / tr >
< / table >
< / dd >
< / dl >
< p > returns length written in p < / p >
< / div >
< / div >
< / div > <!-- contents -->
< / div > <!-- doc - content -->
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul >
< li class = "footer" > Generated by
< a href = "http://www.doxygen.org/index.html" >
2017-03-20 19:37:47 +08:00
< img class = "footer" src = "doxygen.png" alt = "doxygen" / > < / a > 1.8.13 < / li >
2016-06-20 17:05:31 +08:00
< / ul >
< / div >
< / body >
< / html >