Log_8c.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.17"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>MQTT C Client Libraries Internals: Log.c File Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  24. <td id="projectalign" style="padding-left: 0.5em;">
  25. <div id="projectname">MQTT C Client Libraries Internals
  26. </div>
  27. </td>
  28. </tr>
  29. </tbody>
  30. </table>
  31. </div>
  32. <!-- end header part -->
  33. <!-- Generated by Doxygen 1.8.17 -->
  34. <script type="text/javascript">
  35. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  36. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  37. /* @license-end */
  38. </script>
  39. <script type="text/javascript" src="menudata.js"></script>
  40. <script type="text/javascript" src="menu.js"></script>
  41. <script type="text/javascript">
  42. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  43. $(function() {
  44. initMenu('',true,false,'search.php','Search');
  45. $(document).ready(function() { init_search(); });
  46. });
  47. /* @license-end */</script>
  48. <div id="main-nav"></div>
  49. <!-- window showing the filter options -->
  50. <div id="MSearchSelectWindow"
  51. onmouseover="return searchBox.OnSearchSelectShow()"
  52. onmouseout="return searchBox.OnSearchSelectHide()"
  53. onkeydown="return searchBox.OnSearchSelectKey(event)">
  54. </div>
  55. <!-- iframe showing the search results (closed by default) -->
  56. <div id="MSearchResultsWindow">
  57. <iframe src="javascript:void(0)" frameborder="0"
  58. name="MSearchResults" id="MSearchResults">
  59. </iframe>
  60. </div>
  61. </div><!-- top -->
  62. <div class="header">
  63. <div class="summary">
  64. <a href="#nested-classes">Data Structures</a> &#124;
  65. <a href="#define-members">Macros</a> &#124;
  66. <a href="#func-members">Functions</a> &#124;
  67. <a href="#var-members">Variables</a> </div>
  68. <div class="headertitle">
  69. <div class="title">Log.c File Reference</div> </div>
  70. </div><!--header-->
  71. <div class="contents">
  72. <p>Logging and tracing module.
  73. <a href="#details">More...</a></p>
  74. <div class="textblock"><code>#include &quot;Log.h&quot;</code><br />
  75. <code>#include &quot;MQTTPacket.h&quot;</code><br />
  76. <code>#include &quot;MQTTProtocol.h&quot;</code><br />
  77. <code>#include &quot;MQTTProtocolClient.h&quot;</code><br />
  78. <code>#include &quot;Messages.h&quot;</code><br />
  79. <code>#include &quot;LinkedList.h&quot;</code><br />
  80. <code>#include &quot;StackTrace.h&quot;</code><br />
  81. <code>#include &quot;Thread.h&quot;</code><br />
  82. <code>#include &lt;stdio.h&gt;</code><br />
  83. <code>#include &lt;stdlib.h&gt;</code><br />
  84. <code>#include &lt;stdarg.h&gt;</code><br />
  85. <code>#include &lt;time.h&gt;</code><br />
  86. <code>#include &lt;string.h&gt;</code><br />
  87. <code>#include &lt;syslog.h&gt;</code><br />
  88. <code>#include &lt;sys/stat.h&gt;</code><br />
  89. <code>#include &lt;sys/time.h&gt;</code><br />
  90. </div><div class="textblock"><div class="dynheader">
  91. Include dependency graph for Log.c:</div>
  92. <div class="dyncontent">
  93. <div class="center"><img src="Log_8c__incl.png" border="0" usemap="#Log_8c" alt=""/></div>
  94. <map name="Log_8c" id="Log_8c">
  95. <area shape="rect" title="Logging and tracing module." alt="" coords="312,5,367,32"/>
  96. <area shape="rect" title=" " alt="" coords="5,80,65,107"/>
  97. <area shape="rect" title=" " alt="" coords="89,80,152,107"/>
  98. <area shape="rect" title=" " alt="" coords="176,80,244,107"/>
  99. <area shape="rect" title=" " alt="" coords="268,80,325,107"/>
  100. <area shape="rect" title=" " alt="" coords="350,80,414,107"/>
  101. <area shape="rect" title=" " alt="" coords="438,80,507,107"/>
  102. <area shape="rect" title=" " alt="" coords="532,80,611,107"/>
  103. <area shape="rect" title=" " alt="" coords="635,80,716,107"/>
  104. </map>
  105. </div>
  106. </div><table class="memberdecls">
  107. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
  108. Data Structures</h2></td></tr>
  109. <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtraceEntry.html">traceEntry</a></td></tr>
  110. <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
  111. </table><table class="memberdecls">
  112. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
  113. Macros</h2></td></tr>
  114. <tr class="memitem:a3e885d7ac398dca6737f6f97443c634d"><td class="memItemLeft" align="right" valign="top"><a id="a3e885d7ac398dca6737f6f97443c634d"></a>
  115. #define&#160;</td><td class="memItemRight" valign="bottom"><b>GETTIMEOFDAY</b>&#160;&#160;&#160;1</td></tr>
  116. <tr class="separator:a3e885d7ac398dca6737f6f97443c634d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. <tr class="memitem:a411530253569ea29a964f13204da8848"><td class="memItemLeft" align="right" valign="top"><a id="a411530253569ea29a964f13204da8848"></a>
  118. #define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Log_8c.html#a411530253569ea29a964f13204da8848">_unlink</a>&#160;&#160;&#160;unlink</td></tr>
  119. <tr class="memdesc:a411530253569ea29a964f13204da8848"><td class="mdescLeft">&#160;</td><td class="mdescRight">_unlink mapping for linux <br /></td></tr>
  120. <tr class="separator:a411530253569ea29a964f13204da8848"><td class="memSeparator" colspan="2">&#160;</td></tr>
  121. <tr class="memitem:a2d017cd3beb218080a7988e2deed2a11"><td class="memItemLeft" align="right" valign="top"><a id="a2d017cd3beb218080a7988e2deed2a11"></a>
  122. #define&#160;</td><td class="memItemRight" valign="bottom"><b>min</b>(A, B)&#160;&#160;&#160;( (A) &lt; (B) ? (A):(B))</td></tr>
  123. <tr class="separator:a2d017cd3beb218080a7988e2deed2a11"><td class="memSeparator" colspan="2">&#160;</td></tr>
  124. <tr class="memitem:aa03fec699b0d6777b50d67d28c1393c0"><td class="memItemLeft" align="right" valign="top"><a id="aa03fec699b0d6777b50d67d28c1393c0"></a>
  125. #define&#160;</td><td class="memItemRight" valign="bottom"><b>MAX_FUNCTION_NAME_LENGTH</b>&#160;&#160;&#160;256</td></tr>
  126. <tr class="separator:aa03fec699b0d6777b50d67d28c1393c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  127. </table><table class="memberdecls">
  128. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  129. Functions</h2></td></tr>
  130. <tr class="memitem:ac89c9387d0e9288bcfb6bf4dbb318f0f"><td class="memItemLeft" align="right" valign="top"><a id="ac89c9387d0e9288bcfb6bf4dbb318f0f"></a>
  131. static <a class="el" href="structtraceEntry.html">traceEntry</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>Log_pretrace</b> (void)</td></tr>
  132. <tr class="separator:ac89c9387d0e9288bcfb6bf4dbb318f0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  133. <tr class="memitem:a4e314957624cf3b68d92a3e7f444ab04"><td class="memItemLeft" align="right" valign="top"><a id="a4e314957624cf3b68d92a3e7f444ab04"></a>
  134. static char *&#160;</td><td class="memItemRight" valign="bottom"><b>Log_formatTraceEntry</b> (<a class="el" href="structtraceEntry.html">traceEntry</a> *cur_entry)</td></tr>
  135. <tr class="separator:a4e314957624cf3b68d92a3e7f444ab04"><td class="memSeparator" colspan="2">&#160;</td></tr>
  136. <tr class="memitem:aa47715e2e98beab1500d99ff96801967"><td class="memItemLeft" align="right" valign="top"><a id="aa47715e2e98beab1500d99ff96801967"></a>
  137. static void&#160;</td><td class="memItemRight" valign="bottom"><b>Log_output</b> (enum LOG_LEVELS log_level, const char *msg)</td></tr>
  138. <tr class="separator:aa47715e2e98beab1500d99ff96801967"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:a34b3426c0bcb6fa60828a3aa57acc813"><td class="memItemLeft" align="right" valign="top"><a id="a34b3426c0bcb6fa60828a3aa57acc813"></a>
  140. static void&#160;</td><td class="memItemRight" valign="bottom"><b>Log_posttrace</b> (enum LOG_LEVELS log_level, <a class="el" href="structtraceEntry.html">traceEntry</a> *cur_entry)</td></tr>
  141. <tr class="separator:a34b3426c0bcb6fa60828a3aa57acc813"><td class="memSeparator" colspan="2">&#160;</td></tr>
  142. <tr class="memitem:afb7e2da77e4d84bba29f1e3e8d9b6b7b"><td class="memItemLeft" align="right" valign="top"><a id="afb7e2da77e4d84bba29f1e3e8d9b6b7b"></a>
  143. static void&#160;</td><td class="memItemRight" valign="bottom"><b>Log_trace</b> (enum LOG_LEVELS log_level, const char *buf)</td></tr>
  144. <tr class="separator:afb7e2da77e4d84bba29f1e3e8d9b6b7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  145. <tr class="memitem:a38c54bf09a6eb6d0298b96dea84c3d57"><td class="memItemLeft" align="right" valign="top"><a id="a38c54bf09a6eb6d0298b96dea84c3d57"></a>
  146. int&#160;</td><td class="memItemRight" valign="bottom"><b>Log_initialize</b> (<a class="el" href="structLog__nameValue.html">Log_nameValue</a> *info)</td></tr>
  147. <tr class="separator:a38c54bf09a6eb6d0298b96dea84c3d57"><td class="memSeparator" colspan="2">&#160;</td></tr>
  148. <tr class="memitem:a8a3b9a6b2ed60bb8ee665393ace03f44"><td class="memItemLeft" align="right" valign="top"><a id="a8a3b9a6b2ed60bb8ee665393ace03f44"></a>
  149. void&#160;</td><td class="memItemRight" valign="bottom"><b>Log_setTraceCallback</b> (Log_traceCallback *callback)</td></tr>
  150. <tr class="separator:a8a3b9a6b2ed60bb8ee665393ace03f44"><td class="memSeparator" colspan="2">&#160;</td></tr>
  151. <tr class="memitem:addcc3f16c3026d52110ec6b042dee777"><td class="memItemLeft" align="right" valign="top"><a id="addcc3f16c3026d52110ec6b042dee777"></a>
  152. void&#160;</td><td class="memItemRight" valign="bottom"><b>Log_setTraceLevel</b> (enum LOG_LEVELS level)</td></tr>
  153. <tr class="separator:addcc3f16c3026d52110ec6b042dee777"><td class="memSeparator" colspan="2">&#160;</td></tr>
  154. <tr class="memitem:a34bd95b8fd2503c48432f8e337020039"><td class="memItemLeft" align="right" valign="top"><a id="a34bd95b8fd2503c48432f8e337020039"></a>
  155. void&#160;</td><td class="memItemRight" valign="bottom"><b>Log_terminate</b> (void)</td></tr>
  156. <tr class="separator:a34bd95b8fd2503c48432f8e337020039"><td class="memSeparator" colspan="2">&#160;</td></tr>
  157. <tr class="memitem:a669722e3f57811871f97c12392aba85d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Log_8c.html#a669722e3f57811871f97c12392aba85d">Log</a> (enum LOG_LEVELS log_level, int msgno, const char *format,...)</td></tr>
  158. <tr class="memdesc:a669722e3f57811871f97c12392aba85d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Log a message. <a href="Log_8c.html#a669722e3f57811871f97c12392aba85d">More...</a><br /></td></tr>
  159. <tr class="separator:a669722e3f57811871f97c12392aba85d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  160. <tr class="memitem:aeb93e137086d574a96548cecca9e9217"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Log_8c.html#aeb93e137086d574a96548cecca9e9217">Log_stackTrace</a> (enum LOG_LEVELS log_level, int msgno, thread_id_type thread_id, int current_depth, const char *name, int line, int *rc)</td></tr>
  161. <tr class="memdesc:aeb93e137086d574a96548cecca9e9217"><td class="mdescLeft">&#160;</td><td class="mdescRight">The reason for this function is to make trace logging as fast as possible so that the function exit/entry history can be captured by default without unduly impacting performance. <a href="Log_8c.html#aeb93e137086d574a96548cecca9e9217">More...</a><br /></td></tr>
  162. <tr class="separator:aeb93e137086d574a96548cecca9e9217"><td class="memSeparator" colspan="2">&#160;</td></tr>
  163. </table><table class="memberdecls">
  164. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
  165. Variables</h2></td></tr>
  166. <tr class="memitem:a4a51e66471ed77f167e992aaecf1a7c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structtrace__settings__type.html">trace_settings_type</a>&#160;</td><td class="memItemRight" valign="bottom"><b>trace_settings</b></td></tr>
  167. <tr class="separator:a4a51e66471ed77f167e992aaecf1a7c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  168. <tr class="memitem:a559a1d26d36ec391d98bca4d3aa9be0e"><td class="memItemLeft" align="right" valign="top"><a id="a559a1d26d36ec391d98bca4d3aa9be0e"></a>
  169. static int&#160;</td><td class="memItemRight" valign="bottom"><b>start_index</b> = -1</td></tr>
  170. <tr class="separator:a559a1d26d36ec391d98bca4d3aa9be0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  171. <tr class="memitem:a720939920b71c9d9f9410359151d8224"><td class="memItemLeft" align="right" valign="top"><a id="a720939920b71c9d9f9410359151d8224"></a>
  172. static int&#160;</td><td class="memItemRight" valign="bottom"><b>next_index</b> = 0</td></tr>
  173. <tr class="separator:a720939920b71c9d9f9410359151d8224"><td class="memSeparator" colspan="2">&#160;</td></tr>
  174. <tr class="memitem:a0ddc2d22fc8cc3965883229c95b53e78"><td class="memItemLeft" align="right" valign="top"><a id="a0ddc2d22fc8cc3965883229c95b53e78"></a>
  175. static <a class="el" href="structtraceEntry.html">traceEntry</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>trace_queue</b> = NULL</td></tr>
  176. <tr class="separator:a0ddc2d22fc8cc3965883229c95b53e78"><td class="memSeparator" colspan="2">&#160;</td></tr>
  177. <tr class="memitem:af1c4f504f3e58f60dc3a0e84978f7f67"><td class="memItemLeft" align="right" valign="top"><a id="af1c4f504f3e58f60dc3a0e84978f7f67"></a>
  178. static int&#160;</td><td class="memItemRight" valign="bottom"><b>trace_queue_size</b> = 0</td></tr>
  179. <tr class="separator:af1c4f504f3e58f60dc3a0e84978f7f67"><td class="memSeparator" colspan="2">&#160;</td></tr>
  180. <tr class="memitem:a29606f1185cb957cd23842125d7d8ecd"><td class="memItemLeft" align="right" valign="top"><a id="a29606f1185cb957cd23842125d7d8ecd"></a>
  181. static FILE *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Log_8c.html#a29606f1185cb957cd23842125d7d8ecd">trace_destination</a> = NULL</td></tr>
  182. <tr class="memdesc:a29606f1185cb957cd23842125d7d8ecd"><td class="mdescLeft">&#160;</td><td class="mdescRight">flag to indicate if trace is to be sent to a stream <br /></td></tr>
  183. <tr class="separator:a29606f1185cb957cd23842125d7d8ecd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  184. <tr class="memitem:aa46cc371a2f34c92be9e5df8ac162566"><td class="memItemLeft" align="right" valign="top"><a id="aa46cc371a2f34c92be9e5df8ac162566"></a>
  185. static char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Log_8c.html#aa46cc371a2f34c92be9e5df8ac162566">trace_destination_name</a> = NULL</td></tr>
  186. <tr class="memdesc:aa46cc371a2f34c92be9e5df8ac162566"><td class="mdescLeft">&#160;</td><td class="mdescRight">the name of the trace file <br /></td></tr>
  187. <tr class="separator:aa46cc371a2f34c92be9e5df8ac162566"><td class="memSeparator" colspan="2">&#160;</td></tr>
  188. <tr class="memitem:a6e2c5a6602ec82079f7b7c3c1a622f8a"><td class="memItemLeft" align="right" valign="top"><a id="a6e2c5a6602ec82079f7b7c3c1a622f8a"></a>
  189. static char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Log_8c.html#a6e2c5a6602ec82079f7b7c3c1a622f8a">trace_destination_backup_name</a> = NULL</td></tr>
  190. <tr class="memdesc:a6e2c5a6602ec82079f7b7c3c1a622f8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">the name of the backup trace file <br /></td></tr>
  191. <tr class="separator:a6e2c5a6602ec82079f7b7c3c1a622f8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  192. <tr class="memitem:af6d2621ee2d6d01ab6b42b9afbc1c56e"><td class="memItemLeft" align="right" valign="top"><a id="af6d2621ee2d6d01ab6b42b9afbc1c56e"></a>
  193. static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Log_8c.html#af6d2621ee2d6d01ab6b42b9afbc1c56e">lines_written</a> = 0</td></tr>
  194. <tr class="memdesc:af6d2621ee2d6d01ab6b42b9afbc1c56e"><td class="mdescLeft">&#160;</td><td class="mdescRight">number of lines written to the current output file <br /></td></tr>
  195. <tr class="separator:af6d2621ee2d6d01ab6b42b9afbc1c56e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  196. <tr class="memitem:ab0c0e8addd9dc5b2a54aafa15b606435"><td class="memItemLeft" align="right" valign="top"><a id="ab0c0e8addd9dc5b2a54aafa15b606435"></a>
  197. static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Log_8c.html#ab0c0e8addd9dc5b2a54aafa15b606435">max_lines_per_file</a> = 1000</td></tr>
  198. <tr class="memdesc:ab0c0e8addd9dc5b2a54aafa15b606435"><td class="mdescLeft">&#160;</td><td class="mdescRight">maximum number of lines to write to one trace file <br /></td></tr>
  199. <tr class="separator:ab0c0e8addd9dc5b2a54aafa15b606435"><td class="memSeparator" colspan="2">&#160;</td></tr>
  200. <tr class="memitem:a1505e282df45cd7e0e0570a2830f4574"><td class="memItemLeft" align="right" valign="top"><a id="a1505e282df45cd7e0e0570a2830f4574"></a>
  201. static enum LOG_LEVELS&#160;</td><td class="memItemRight" valign="bottom"><b>trace_output_level</b> = INVALID_LEVEL</td></tr>
  202. <tr class="separator:a1505e282df45cd7e0e0570a2830f4574"><td class="memSeparator" colspan="2">&#160;</td></tr>
  203. <tr class="memitem:a3f8afd46f428fa36804af822bfb0b01b"><td class="memItemLeft" align="right" valign="top"><a id="a3f8afd46f428fa36804af822bfb0b01b"></a>
  204. static Log_traceCallback *&#160;</td><td class="memItemRight" valign="bottom"><b>trace_callback</b> = NULL</td></tr>
  205. <tr class="separator:a3f8afd46f428fa36804af822bfb0b01b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  206. <tr class="memitem:a8fb2059e64a46fb559e978427def3518"><td class="memItemLeft" align="right" valign="top"><a id="a8fb2059e64a46fb559e978427def3518"></a>
  207. static int&#160;</td><td class="memItemRight" valign="bottom"><b>sametime_count</b> = 0</td></tr>
  208. <tr class="separator:a8fb2059e64a46fb559e978427def3518"><td class="memSeparator" colspan="2">&#160;</td></tr>
  209. <tr class="memitem:aca38e8f36fc371eb9fc8f2839ec28130"><td class="memItemLeft" align="right" valign="top"><a id="aca38e8f36fc371eb9fc8f2839ec28130"></a>
  210. struct timeval now_ts&#160;</td><td class="memItemRight" valign="bottom"><b>last_ts</b></td></tr>
  211. <tr class="separator:aca38e8f36fc371eb9fc8f2839ec28130"><td class="memSeparator" colspan="2">&#160;</td></tr>
  212. <tr class="memitem:a0edda13b46be84257a7de2779aeaf481"><td class="memItemLeft" align="right" valign="top"><a id="a0edda13b46be84257a7de2779aeaf481"></a>
  213. static char&#160;</td><td class="memItemRight" valign="bottom"><b>msg_buf</b> [512]</td></tr>
  214. <tr class="separator:a0edda13b46be84257a7de2779aeaf481"><td class="memSeparator" colspan="2">&#160;</td></tr>
  215. <tr class="memitem:a551c121ca3931d4af92f85a8f9cf0cd5"><td class="memItemLeft" align="right" valign="top"><a id="a551c121ca3931d4af92f85a8f9cf0cd5"></a>
  216. static pthread_mutex_t&#160;</td><td class="memItemRight" valign="bottom"><b>log_mutex_store</b> = PTHREAD_MUTEX_INITIALIZER</td></tr>
  217. <tr class="separator:a551c121ca3931d4af92f85a8f9cf0cd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  218. <tr class="memitem:a1d8e166556a1a6c79cb76e7004c1beca"><td class="memItemLeft" align="right" valign="top"><a id="a1d8e166556a1a6c79cb76e7004c1beca"></a>
  219. static mutex_type&#160;</td><td class="memItemRight" valign="bottom"><b>log_mutex</b> = &amp;log_mutex_store</td></tr>
  220. <tr class="separator:a1d8e166556a1a6c79cb76e7004c1beca"><td class="memSeparator" colspan="2">&#160;</td></tr>
  221. </table>
  222. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  223. <div class="textblock"><p>Logging and tracing module. </p>
  224. </div><h2 class="groupheader">Function Documentation</h2>
  225. <a id="a669722e3f57811871f97c12392aba85d"></a>
  226. <h2 class="memtitle"><span class="permalink"><a href="#a669722e3f57811871f97c12392aba85d">&#9670;&nbsp;</a></span>Log()</h2>
  227. <div class="memitem">
  228. <div class="memproto">
  229. <table class="memname">
  230. <tr>
  231. <td class="memname">void Log </td>
  232. <td>(</td>
  233. <td class="paramtype">enum LOG_LEVELS&#160;</td>
  234. <td class="paramname"><em>log_level</em>, </td>
  235. </tr>
  236. <tr>
  237. <td class="paramkey"></td>
  238. <td></td>
  239. <td class="paramtype">int&#160;</td>
  240. <td class="paramname"><em>msgno</em>, </td>
  241. </tr>
  242. <tr>
  243. <td class="paramkey"></td>
  244. <td></td>
  245. <td class="paramtype">const char *&#160;</td>
  246. <td class="paramname"><em>format</em>, </td>
  247. </tr>
  248. <tr>
  249. <td class="paramkey"></td>
  250. <td></td>
  251. <td class="paramtype">&#160;</td>
  252. <td class="paramname"><em>...</em>&#160;</td>
  253. </tr>
  254. <tr>
  255. <td></td>
  256. <td>)</td>
  257. <td></td><td></td>
  258. </tr>
  259. </table>
  260. </div><div class="memdoc">
  261. <p>Log a message. </p>
  262. <p>If possible, all messages should be indexed by message number, and the use of the format string should be minimized or negated altogether. If format is provided, the message number is only used as a message label. </p><dl class="params"><dt>Parameters</dt><dd>
  263. <table class="params">
  264. <tr><td class="paramname">log_level</td><td>the log level of the message </td></tr>
  265. <tr><td class="paramname">msgno</td><td>the id of the message to use if the format string is NULL </td></tr>
  266. <tr><td class="paramname">aFormat</td><td>the printf format string to be used if the message id does not exist </td></tr>
  267. <tr><td class="paramname">...</td><td>the printf inserts </td></tr>
  268. </table>
  269. </dd>
  270. </dl>
  271. </div>
  272. </div>
  273. <a id="aeb93e137086d574a96548cecca9e9217"></a>
  274. <h2 class="memtitle"><span class="permalink"><a href="#aeb93e137086d574a96548cecca9e9217">&#9670;&nbsp;</a></span>Log_stackTrace()</h2>
  275. <div class="memitem">
  276. <div class="memproto">
  277. <table class="memname">
  278. <tr>
  279. <td class="memname">void Log_stackTrace </td>
  280. <td>(</td>
  281. <td class="paramtype">enum LOG_LEVELS&#160;</td>
  282. <td class="paramname"><em>log_level</em>, </td>
  283. </tr>
  284. <tr>
  285. <td class="paramkey"></td>
  286. <td></td>
  287. <td class="paramtype">int&#160;</td>
  288. <td class="paramname"><em>msgno</em>, </td>
  289. </tr>
  290. <tr>
  291. <td class="paramkey"></td>
  292. <td></td>
  293. <td class="paramtype">thread_id_type&#160;</td>
  294. <td class="paramname"><em>thread_id</em>, </td>
  295. </tr>
  296. <tr>
  297. <td class="paramkey"></td>
  298. <td></td>
  299. <td class="paramtype">int&#160;</td>
  300. <td class="paramname"><em>current_depth</em>, </td>
  301. </tr>
  302. <tr>
  303. <td class="paramkey"></td>
  304. <td></td>
  305. <td class="paramtype">const char *&#160;</td>
  306. <td class="paramname"><em>name</em>, </td>
  307. </tr>
  308. <tr>
  309. <td class="paramkey"></td>
  310. <td></td>
  311. <td class="paramtype">int&#160;</td>
  312. <td class="paramname"><em>line</em>, </td>
  313. </tr>
  314. <tr>
  315. <td class="paramkey"></td>
  316. <td></td>
  317. <td class="paramtype">int *&#160;</td>
  318. <td class="paramname"><em>rc</em>&#160;</td>
  319. </tr>
  320. <tr>
  321. <td></td>
  322. <td>)</td>
  323. <td></td><td></td>
  324. </tr>
  325. </table>
  326. </div><div class="memdoc">
  327. <p>The reason for this function is to make trace logging as fast as possible so that the function exit/entry history can be captured by default without unduly impacting performance. </p>
  328. <p>Therefore it must do as little as possible. </p><dl class="params"><dt>Parameters</dt><dd>
  329. <table class="params">
  330. <tr><td class="paramname">log_level</td><td>the log level of the message </td></tr>
  331. <tr><td class="paramname">msgno</td><td>the id of the message to use if the format string is NULL </td></tr>
  332. <tr><td class="paramname">aFormat</td><td>the printf format string to be used if the message id does not exist </td></tr>
  333. <tr><td class="paramname">...</td><td>the printf inserts </td></tr>
  334. </table>
  335. </dd>
  336. </dl>
  337. </div>
  338. </div>
  339. <h2 class="groupheader">Variable Documentation</h2>
  340. <a id="a4a51e66471ed77f167e992aaecf1a7c7"></a>
  341. <h2 class="memtitle"><span class="permalink"><a href="#a4a51e66471ed77f167e992aaecf1a7c7">&#9670;&nbsp;</a></span>trace_settings</h2>
  342. <div class="memitem">
  343. <div class="memproto">
  344. <table class="memname">
  345. <tr>
  346. <td class="memname"><a class="el" href="structtrace__settings__type.html">trace_settings_type</a> trace_settings</td>
  347. </tr>
  348. </table>
  349. </div><div class="memdoc">
  350. <b>Initial value:</b><div class="fragment"><div class="line">=</div>
  351. <div class="line">{</div>
  352. <div class="line"> </div>
  353. <div class="line"> </div>
  354. <div class="line"> </div>
  355. <div class="line"> TRACE_MINIMUM,</div>
  356. <div class="line"> </div>
  357. <div class="line"> 400,</div>
  358. <div class="line"> INVALID_LEVEL</div>
  359. <div class="line">}</div>
  360. </div><!-- fragment -->
  361. </div>
  362. </div>
  363. </div><!-- contents -->
  364. <!-- start footer part -->
  365. <hr class="footer"/><address class="footer"><small>
  366. Generated on Thu Sep 29 2022 11:34:46 for MQTT C Client Libraries Internals by &#160;<a href="http://www.doxygen.org/index.html">
  367. <img class="footer" src="doxygen.png" alt="doxygen"/>
  368. </a> 1.8.17
  369. </small></address>
  370. </body>
  371. </html>