md_doc_logging.html 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.13"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>tpm2-tss: Compile time log levels</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="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript">
  17. $(document).ready(initResizable);
  18. </script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. </head>
  21. <body>
  22. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  23. <div id="titlearea">
  24. <table cellspacing="0" cellpadding="0">
  25. <tbody>
  26. <tr style="height: 56px;">
  27. <td id="projectalign" style="padding-left: 0.5em;">
  28. <div id="projectname">tpm2-tss
  29. &#160;<span id="projectnumber">3.2.0</span>
  30. </div>
  31. <div id="projectbrief">TPM Software stack 2.0 TCG spec compliant implementation</div>
  32. </td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. <!-- end header part -->
  38. <!-- Generated by Doxygen 1.8.13 -->
  39. <script type="text/javascript" src="menudata.js"></script>
  40. <script type="text/javascript" src="menu.js"></script>
  41. <script type="text/javascript">
  42. $(function() {
  43. initMenu('',false,false,'search.php','Search');
  44. });
  45. </script>
  46. <div id="main-nav"></div>
  47. </div><!-- top -->
  48. <div id="side-nav" class="ui-resizable side-nav-resizable">
  49. <div id="nav-tree">
  50. <div id="nav-tree-contents">
  51. <div id="nav-sync" class="sync"></div>
  52. </div>
  53. </div>
  54. <div id="splitbar" style="-moz-user-select:none;"
  55. class="ui-resizable-handle">
  56. </div>
  57. </div>
  58. <script type="text/javascript">
  59. $(document).ready(function(){initNavTree('md_doc_logging.html','');});
  60. </script>
  61. <div id="doc-content">
  62. <div class="header">
  63. <div class="headertitle">
  64. <div class="title">Compile time log levels </div> </div>
  65. </div><!--header-->
  66. <div class="contents">
  67. <div class="textblock"><p>At compile time the maximum log level can be specified. This allows distros to disable the overhead code and reduce overall code size.</p>
  68. <h1>Runtime log level</h1>
  69. <p>At runtime, the log level is determined by an environment variable. The default log level is WARNING. The level can be changed by setting the <code>TSS2_LOG</code> environment variable.</p>
  70. <p>Possible levels are: NONE, ERROR, WARNING, INFO, DEBUG, TRACE</p>
  71. <p>The level can be set for all module using the <code>all</code> module name or individually per module. The environment variable is evaluated left to right.</p>
  72. <p>Example: <code>TSS2_LOG=all+ERROR,marshal+TRACE,tcti+DEBUG</code></p>
  73. <h1>Log file</h1>
  74. <p>By default, logs are written to standard error (<code>stderr</code>). If the environment variable <code>TSS2_LOGFILE</code> is set, the TSS will log to the file at the given path instead. If the file does not yet exist, it will be created. Otherwise, the TSS will append to it.</p>
  75. <p>The special value <code>stderr</code> will result in default behavior while <code>stdout</code> and <code>-</code> will have the TSS write to standard output.</p>
  76. <h1>Implementation</h1>
  77. <p>Each source code file specifies its corresponding module before including log.h. </p><div class="fragment"><div class="line">#define LOGMODULE tcti</div><div class="line">#include &quot;log.h&quot;</div></div><!-- fragment --><p> Optionally, the default log-level for this module can be set: </p><div class="fragment"><div class="line">#define LOGMODULE tcti</div><div class="line">#define LOGDEFAULT ERROR</div><div class="line">#include &quot;log.h&quot;</div></div><!-- fragment --> </div></div><!-- contents -->
  78. </div><!-- doc-content -->
  79. <!-- start footer part -->
  80. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  81. <ul>
  82. <li class="footer">Generated by
  83. <a href="http://www.doxygen.org/index.html">
  84. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  85. </ul>
  86. </div>
  87. </body>
  88. </html>