logger_8cpp.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.10"/>
  7. <title>CoffeePi: logger.cpp File Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="search/searchdata.js"></script>
  13. <script type="text/javascript" src="search/search.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(function() { init_search(); });
  16. </script>
  17. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body>
  20. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  21. <div id="titlearea">
  22. <table cellspacing="0" cellpadding="0">
  23. <tbody>
  24. <tr style="height: 56px;">
  25. <td id="projectalign" style="padding-left: 0.5em;">
  26. <div id="projectname">CoffeePi
  27. </div>
  28. <div id="projectbrief">Coffee machine control for Raspberry Pi</div>
  29. </td>
  30. </tr>
  31. </tbody>
  32. </table>
  33. </div>
  34. <!-- end header part -->
  35. <!-- Generated by Doxygen 1.8.10 -->
  36. <script type="text/javascript">
  37. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  38. </script>
  39. <div id="navrow1" class="tabs">
  40. <ul class="tablist">
  41. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  42. <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  43. <li class="current"><a href="files.html"><span>Files</span></a></li>
  44. <li>
  45. <div id="MSearchBox" class="MSearchBoxInactive">
  46. <span class="left">
  47. <img id="MSearchSelect" src="search/mag_sel.png"
  48. onmouseover="return searchBox.OnSearchSelectShow()"
  49. onmouseout="return searchBox.OnSearchSelectHide()"
  50. alt=""/>
  51. <input type="text" id="MSearchField" value="Search" accesskey="S"
  52. onfocus="searchBox.OnSearchFieldFocus(true)"
  53. onblur="searchBox.OnSearchFieldFocus(false)"
  54. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  55. </span><span class="right">
  56. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  57. </span>
  58. </div>
  59. </li>
  60. </ul>
  61. </div>
  62. <div id="navrow2" class="tabs2">
  63. <ul class="tablist">
  64. <li><a href="files.html"><span>File&#160;List</span></a></li>
  65. <li><a href="globals.html"><span>Globals</span></a></li>
  66. </ul>
  67. </div>
  68. <!-- window showing the filter options -->
  69. <div id="MSearchSelectWindow"
  70. onmouseover="return searchBox.OnSearchSelectShow()"
  71. onmouseout="return searchBox.OnSearchSelectHide()"
  72. onkeydown="return searchBox.OnSearchSelectKey(event)">
  73. </div>
  74. <!-- iframe showing the search results (closed by default) -->
  75. <div id="MSearchResultsWindow">
  76. <iframe src="javascript:void(0)" frameborder="0"
  77. name="MSearchResults" id="MSearchResults">
  78. </iframe>
  79. </div>
  80. </div><!-- top -->
  81. <div class="header">
  82. <div class="summary">
  83. <a href="#func-members">Functions</a> &#124;
  84. <a href="#var-members">Variables</a> </div>
  85. <div class="headertitle">
  86. <div class="title">logger.cpp File Reference</div> </div>
  87. </div><!--header-->
  88. <div class="contents">
  89. <div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
  90. <code>#include &lt;stdarg.h&gt;</code><br />
  91. <code>#include &lt;time.h&gt;</code><br />
  92. <code>#include &quot;<a class="el" href="global_8h_source.html">global.h</a>&quot;</code><br />
  93. <code>#include &quot;<a class="el" href="logger_8h_source.html">logger.h</a>&quot;</code><br />
  94. </div><table class="memberdecls">
  95. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  96. Functions</h2></td></tr>
  97. <tr class="memitem:aeb33ace0bb24787befc4a34c561634b4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logger_8cpp.html#aeb33ace0bb24787befc4a34c561634b4">logger_print_time</a> (_IO_FILE *stream)</td></tr>
  98. <tr class="memdesc:aeb33ace0bb24787befc4a34c561634b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints a timestamp. <a href="#aeb33ace0bb24787befc4a34c561634b4">More...</a><br /></td></tr>
  99. <tr class="separator:aeb33ace0bb24787befc4a34c561634b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  100. <tr class="memitem:ab5a2104bf520b79d590c6ef11cdeeb02"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logger_8cpp.html#ab5a2104bf520b79d590c6ef11cdeeb02">logger_error</a> (const char *format,...)</td></tr>
  101. <tr class="memdesc:ab5a2104bf520b79d590c6ef11cdeeb02"><td class="mdescLeft">&#160;</td><td class="mdescRight">Outputs the printf like formatted message to stderr and colorizes it. <a href="#ab5a2104bf520b79d590c6ef11cdeeb02">More...</a><br /></td></tr>
  102. <tr class="separator:ab5a2104bf520b79d590c6ef11cdeeb02"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. <tr class="memitem:abd01f221b7a194e67bb39d88822c9772"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logger_8cpp.html#abd01f221b7a194e67bb39d88822c9772">logger_reset</a> ()</td></tr>
  104. <tr class="memdesc:abd01f221b7a194e67bb39d88822c9772"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the logger to prevent the previous line being overdrawn. <a href="#abd01f221b7a194e67bb39d88822c9772">More...</a><br /></td></tr>
  105. <tr class="separator:abd01f221b7a194e67bb39d88822c9772"><td class="memSeparator" colspan="2">&#160;</td></tr>
  106. <tr class="memitem:a1f2dbdf600d66c1c1bcc820d0282d132"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logger_8cpp.html#a1f2dbdf600d66c1c1bcc820d0282d132">logger</a> (<a class="el" href="logger_8h.html#a1cfb4eb1363ea2e4d18f9052a7a98131">logger_verbose_t</a> verboselevel, <a class="el" href="logger_8h.html#a60cbc432422370d29ed1b783be884823">logger_type_t</a> logtype, const char *format,...)</td></tr>
  107. <tr class="memdesc:a1f2dbdf600d66c1c1bcc820d0282d132"><td class="mdescLeft">&#160;</td><td class="mdescRight">prints the message to stdout and formats it <a href="#a1f2dbdf600d66c1c1bcc820d0282d132">More...</a><br /></td></tr>
  108. <tr class="separator:a1f2dbdf600d66c1c1bcc820d0282d132"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <tr class="memitem:ad6ed0024f33524ff5e96b473a18b44fd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logger_8cpp.html#ad6ed0024f33524ff5e96b473a18b44fd">logger</a> (<a class="el" href="logger_8h.html#a1cfb4eb1363ea2e4d18f9052a7a98131">logger_verbose_t</a> verboselevel, const char *format,...)</td></tr>
  110. <tr class="memdesc:ad6ed0024f33524ff5e96b473a18b44fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">prints the message to stdout <a href="#ad6ed0024f33524ff5e96b473a18b44fd">More...</a><br /></td></tr>
  111. <tr class="separator:ad6ed0024f33524ff5e96b473a18b44fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  112. </table><table class="memberdecls">
  113. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
  114. Variables</h2></td></tr>
  115. <tr class="memitem:a05db4cbb4a1c322f0adebb466081c99e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="logger_8cpp.html#a05db4cbb4a1c322f0adebb466081c99e">lastlog</a> = 0</td></tr>
  116. <tr class="separator:a05db4cbb4a1c322f0adebb466081c99e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. </table>
  118. <h2 class="groupheader">Function Documentation</h2>
  119. <a class="anchor" id="a1f2dbdf600d66c1c1bcc820d0282d132"></a>
  120. <div class="memitem">
  121. <div class="memproto">
  122. <table class="memname">
  123. <tr>
  124. <td class="memname">void logger </td>
  125. <td>(</td>
  126. <td class="paramtype"><a class="el" href="logger_8h.html#a1cfb4eb1363ea2e4d18f9052a7a98131">logger_verbose_t</a>&#160;</td>
  127. <td class="paramname"><em>verboselevel</em>, </td>
  128. </tr>
  129. <tr>
  130. <td class="paramkey"></td>
  131. <td></td>
  132. <td class="paramtype"><a class="el" href="logger_8h.html#a60cbc432422370d29ed1b783be884823">logger_type_t</a>&#160;</td>
  133. <td class="paramname"><em>logtype</em>, </td>
  134. </tr>
  135. <tr>
  136. <td class="paramkey"></td>
  137. <td></td>
  138. <td class="paramtype">const char *&#160;</td>
  139. <td class="paramname"><em>format</em>, </td>
  140. </tr>
  141. <tr>
  142. <td class="paramkey"></td>
  143. <td></td>
  144. <td class="paramtype">&#160;</td>
  145. <td class="paramname"><em>...</em>&#160;</td>
  146. </tr>
  147. <tr>
  148. <td></td>
  149. <td>)</td>
  150. <td></td><td></td>
  151. </tr>
  152. </table>
  153. </div><div class="memdoc">
  154. <p>prints the message to stdout and formats it </p>
  155. <dl class="params"><dt>Parameters</dt><dd>
  156. <table class="params">
  157. <tr><td class="paramname">verboselevel</td><td>minimum verbose level for output </td></tr>
  158. <tr><td class="paramname">logtype</td><td>type of logmessage for coloring </td></tr>
  159. <tr><td class="paramname">format</td><td>printf formatted string </td></tr>
  160. </table>
  161. </dd>
  162. </dl>
  163. </div>
  164. </div>
  165. <a class="anchor" id="ad6ed0024f33524ff5e96b473a18b44fd"></a>
  166. <div class="memitem">
  167. <div class="memproto">
  168. <table class="memname">
  169. <tr>
  170. <td class="memname">void logger </td>
  171. <td>(</td>
  172. <td class="paramtype"><a class="el" href="logger_8h.html#a1cfb4eb1363ea2e4d18f9052a7a98131">logger_verbose_t</a>&#160;</td>
  173. <td class="paramname"><em>verboselevel</em>, </td>
  174. </tr>
  175. <tr>
  176. <td class="paramkey"></td>
  177. <td></td>
  178. <td class="paramtype">const char *&#160;</td>
  179. <td class="paramname"><em>format</em>, </td>
  180. </tr>
  181. <tr>
  182. <td class="paramkey"></td>
  183. <td></td>
  184. <td class="paramtype">&#160;</td>
  185. <td class="paramname"><em>...</em>&#160;</td>
  186. </tr>
  187. <tr>
  188. <td></td>
  189. <td>)</td>
  190. <td></td><td></td>
  191. </tr>
  192. </table>
  193. </div><div class="memdoc">
  194. <p>prints the message to stdout </p>
  195. <dl class="params"><dt>Parameters</dt><dd>
  196. <table class="params">
  197. <tr><td class="paramname">verboselevel</td><td>minimum verbose level for output </td></tr>
  198. <tr><td class="paramname">format</td><td>printf formatted string </td></tr>
  199. </table>
  200. </dd>
  201. </dl>
  202. </div>
  203. </div>
  204. <a class="anchor" id="ab5a2104bf520b79d590c6ef11cdeeb02"></a>
  205. <div class="memitem">
  206. <div class="memproto">
  207. <table class="memname">
  208. <tr>
  209. <td class="memname">void logger_error </td>
  210. <td>(</td>
  211. <td class="paramtype">const char *&#160;</td>
  212. <td class="paramname"><em>format</em>, </td>
  213. </tr>
  214. <tr>
  215. <td class="paramkey"></td>
  216. <td></td>
  217. <td class="paramtype">&#160;</td>
  218. <td class="paramname"><em>...</em>&#160;</td>
  219. </tr>
  220. <tr>
  221. <td></td>
  222. <td>)</td>
  223. <td></td><td></td>
  224. </tr>
  225. </table>
  226. </div><div class="memdoc">
  227. <p>Outputs the printf like formatted message to stderr and colorizes it. </p>
  228. <dl class="params"><dt>Parameters</dt><dd>
  229. <table class="params">
  230. <tr><td class="paramname">format</td><td>printf formatted string </td></tr>
  231. </table>
  232. </dd>
  233. </dl>
  234. </div>
  235. </div>
  236. <a class="anchor" id="aeb33ace0bb24787befc4a34c561634b4"></a>
  237. <div class="memitem">
  238. <div class="memproto">
  239. <table class="memname">
  240. <tr>
  241. <td class="memname">void logger_print_time </td>
  242. <td>(</td>
  243. <td class="paramtype">_IO_FILE *&#160;</td>
  244. <td class="paramname"><em>stream</em></td><td>)</td>
  245. <td></td>
  246. </tr>
  247. </table>
  248. </div><div class="memdoc">
  249. <p>Prints a timestamp. </p>
  250. <dl class="params"><dt>Parameters</dt><dd>
  251. <table class="params">
  252. <tr><td class="paramname">stream</td><td>target stream (stdout, stderr) </td></tr>
  253. </table>
  254. </dd>
  255. </dl>
  256. </div>
  257. </div>
  258. <a class="anchor" id="abd01f221b7a194e67bb39d88822c9772"></a>
  259. <div class="memitem">
  260. <div class="memproto">
  261. <table class="memname">
  262. <tr>
  263. <td class="memname">void logger_reset </td>
  264. <td>(</td>
  265. <td class="paramname"></td><td>)</td>
  266. <td></td>
  267. </tr>
  268. </table>
  269. </div><div class="memdoc">
  270. <p>Resets the logger to prevent the previous line being overdrawn. </p>
  271. <p>Call after custom printf </p>
  272. </div>
  273. </div>
  274. <h2 class="groupheader">Variable Documentation</h2>
  275. <a class="anchor" id="a05db4cbb4a1c322f0adebb466081c99e"></a>
  276. <div class="memitem">
  277. <div class="memproto">
  278. <table class="memname">
  279. <tr>
  280. <td class="memname">int lastlog = 0</td>
  281. </tr>
  282. </table>
  283. </div><div class="memdoc">
  284. </div>
  285. </div>
  286. </div><!-- contents -->
  287. <!-- start footer part -->
  288. <hr class="footer"/><address class="footer"><small>
  289. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  290. <img class="footer" src="doxygen.png" alt="doxygen"/>
  291. </a> 1.8.10
  292. </small></address>
  293. </body>
  294. </html>