fix build script to handle documentation correctly

- make doc target was disabled by default.
- update documentation.
This commit is contained in:
Johann Dreo 2020-11-01 19:23:48 +01:00
commit ad8fc14cf5
16 changed files with 177 additions and 76 deletions

View file

@ -93,24 +93,25 @@ $(function() {
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#a10fd25a1b51c8c95bd6d876ce1b4b928">level</a> enum name</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#acebed8c9df9204f22bf8488e62e1cedd">level_of</a>(const std::string name)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#aa26c6b81ebaeb9e9daa3457e3a3d17c9">line</a>(std::string line)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#a4ebdfcded6c56262676bf6926d63fc96">locate</a>(const level &amp;stage, const std::string &amp;file, const std::string &amp;func, const size_t line) const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#a4ebdfcded6c56262676bf6926d63fc96">locate</a>(const level &amp;stage, const std::string &amp;file, const std::string &amp;func, const size_t line) const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#a6666106b9e5c239b6ae5e0d1091648e3">location</a>(const std::string &amp;in_file, const std::string &amp;in_function=&quot;.*&quot;, const std::string &amp;in_line=&quot;.*&quot;)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#a23dbb98f0d3c5cc21c232cde16cf317a">log</a>(const level &amp;stage, const std::string &amp;what, const std::string &amp;file, const std::string &amp;func, size_t line) const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">logger</a>()</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>note</b> enum value (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>operator=</b>(clutchlog const &amp;)=delete (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#a7fd7c7bd3668c537061c314a619a336d">out</a>(std::ostream &amp;out)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#a6c6ab42a1df147e6c2d115bc36ec8266">out</a>()</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>progress</b> enum value (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#a972f895c70edc335f3018a2c8971d59e">replace</a>(const std::string &amp;form, const std::string &amp;mark, const std::string &amp;tag) const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#ae90d5a1a428587ad67b38b2ea4ca9fa2">replace</a>(const std::string &amp;form, const std::string &amp;mark, const size_t tag) const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#ac3ec55057b9c734b66f169bf43dbd591">style</a>(level stage, FMT... styles)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#ad1cfa9945c3f7f98fe8ce724c627d0d6">style</a>(level stage, fmt style)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#a4831f44fd5ade102e57320632095934d">style</a>(level stage) const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#a3cb0e4f43a4cadf1966001ad7c9861f4">threshold</a>(level l)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#ab45287cc9c14217904a13aff49573732">threshold</a>() const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>warning</b> enum value (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>xdebug</b> enum value (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>max_buffer</b> (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>note</b> enum value (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>operator=</b>(clutchlog const &amp;)=delete (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#a7fd7c7bd3668c537061c314a619a336d">out</a>(std::ostream &amp;out)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#a6c6ab42a1df147e6c2d115bc36ec8266">out</a>()</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>progress</b> enum value (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#a972f895c70edc335f3018a2c8971d59e">replace</a>(const std::string &amp;form, const std::string &amp;mark, const std::string &amp;tag) const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#ae90d5a1a428587ad67b38b2ea4ca9fa2">replace</a>(const std::string &amp;form, const std::string &amp;mark, const size_t tag) const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#ac3ec55057b9c734b66f169bf43dbd591">style</a>(level stage, FMT... styles)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#ad1cfa9945c3f7f98fe8ce724c627d0d6">style</a>(level stage, fmt style)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#a4831f44fd5ade102e57320632095934d">style</a>(level stage) const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classclutchlog.html#a3cb0e4f43a4cadf1966001ad7c9861f4">threshold</a>(level l)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classclutchlog.html#ab45287cc9c14217904a13aff49573732">threshold</a>() const</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>warning</b> enum value (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>xdebug</b> enum value (defined in <a class="el" href="classclutchlog.html">clutchlog</a>)</td><td class="entry"><a class="el" href="classclutchlog.html">clutchlog</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

View file

@ -143,6 +143,10 @@ void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="clas
<tr class="memdesc:acebed8c9df9204f22bf8488e62e1cedd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the log level tag corresponding to the given pre-configured name. <a href="#acebed8c9df9204f22bf8488e62e1cedd">More...</a><br /></td></tr>
<tr class="separator:acebed8c9df9204f22bf8488e62e1cedd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Low-level API</div></td></tr>
<tr class="memitem:a4ebdfcded6c56262676bf6926d63fc96"><td class="memItemLeft" align="right" valign="top"><a id="a4ebdfcded6c56262676bf6926d63fc96"></a>
<a class="el" href="structclutchlog_1_1scope__t.html">scope_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classclutchlog.html#a4ebdfcded6c56262676bf6926d63fc96">locate</a> (const <a class="el" href="classclutchlog.html#a10fd25a1b51c8c95bd6d876ce1b4b928">level</a> &amp;stage, const std::string &amp;<a class="el" href="classclutchlog.html#a10064493c22f5c03b502a42d814c5c5c">file</a>, const std::string &amp;<a class="el" href="classclutchlog.html#ad32b5a0274dc03ee0004f67ba58b2447">func</a>, const size_t <a class="el" href="classclutchlog.html#aa26c6b81ebaeb9e9daa3457e3a3d17c9">line</a>) const</td></tr>
<tr class="memdesc:a4ebdfcded6c56262676bf6926d63fc96"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gather information on the current location of the call. <br /></td></tr>
<tr class="separator:a4ebdfcded6c56262676bf6926d63fc96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a972f895c70edc335f3018a2c8971d59e"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classclutchlog.html#a972f895c70edc335f3018a2c8971d59e">replace</a> (const std::string &amp;form, const std::string &amp;mark, const std::string &amp;tag) const</td></tr>
<tr class="memdesc:a972f895c70edc335f3018a2c8971d59e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replace <code>mark</code> by <code>tag</code> in <code>form</code>. <a href="#a972f895c70edc335f3018a2c8971d59e">More...</a><br /></td></tr>
<tr class="separator:a972f895c70edc335f3018a2c8971d59e"><td class="memSeparator" colspan="2">&#160;</td></tr>
@ -219,16 +223,15 @@ std::regex&#160;</td><td class="memItemRight" valign="bottom"><b>_in_func</b></t
<tr class="memitem:a41757198b29862832a14472a9e5e24c6"><td class="memItemLeft" align="right" valign="top"><a id="a41757198b29862832a14472a9e5e24c6"></a>
std::regex&#160;</td><td class="memItemRight" valign="bottom"><b>_in_line</b></td></tr>
<tr class="separator:a41757198b29862832a14472a9e5e24c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6a8aef8df1de520a42ee68ee756fbf3"><td class="memItemLeft" align="right" valign="top"><a id="ad6a8aef8df1de520a42ee68ee756fbf3"></a>
static const size_t&#160;</td><td class="memItemRight" valign="bottom"><b>max_buffer</b> = 4096</td></tr>
<tr class="separator:ad6a8aef8df1de520a42ee68ee756fbf3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0906d74275cedcd403da94879764815e"><td class="memItemLeft" align="right" valign="top"><a id="a0906d74275cedcd403da94879764815e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>clutchlog</b> (<a class="el" href="classclutchlog.html">clutchlog</a> const &amp;)=delete</td></tr>
<tr class="separator:a0906d74275cedcd403da94879764815e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef653a9744a72a889ca8163269bb781e"><td class="memItemLeft" align="right" valign="top"><a id="aef653a9744a72a889ca8163269bb781e"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classclutchlog.html">clutchlog</a> const &amp;)=delete</td></tr>
<tr class="separator:aef653a9744a72a889ca8163269bb781e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ebdfcded6c56262676bf6926d63fc96"><td class="memItemLeft" align="right" valign="top"><a id="a4ebdfcded6c56262676bf6926d63fc96"></a>
<a class="el" href="structclutchlog_1_1scope__t.html">scope_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classclutchlog.html#a4ebdfcded6c56262676bf6926d63fc96">locate</a> (const <a class="el" href="classclutchlog.html#a10fd25a1b51c8c95bd6d876ce1b4b928">level</a> &amp;stage, const std::string &amp;<a class="el" href="classclutchlog.html#a10064493c22f5c03b502a42d814c5c5c">file</a>, const std::string &amp;<a class="el" href="classclutchlog.html#ad32b5a0274dc03ee0004f67ba58b2447">func</a>, const size_t <a class="el" href="classclutchlog.html#aa26c6b81ebaeb9e9daa3457e3a3d17c9">line</a>) const</td></tr>
<tr class="memdesc:a4ebdfcded6c56262676bf6926d63fc96"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gather information on the current location of the call. <br /></td></tr>
<tr class="separator:a4ebdfcded6c56262676bf6926d63fc96"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="acebed8c9df9204f22bf8488e62e1cedd"></a>

View file

@ -120,10 +120,12 @@ Macros</h2></td></tr>
<tr class="memdesc:ga54d29e956575e1c731eab5406135c5df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default item separator for dump. <br /></td></tr>
<tr class="separator:ga54d29e956575e1c731eab5406135c5df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga45c4c964fad4ad1641d5c9c28c4645b9"><td class="memItemLeft" align="right" valign="top">
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CLUTCHLOG_DEFAULT_DEPTH_MARK</b>&#160;&#160;&#160;&quot;&gt;&quot;</td></tr>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DefaultConfigMacros.html#ga45c4c964fad4ad1641d5c9c28c4645b9">CLUTCHLOG_DEFAULT_DEPTH_MARK</a>&#160;&#160;&#160;&quot;&gt;&quot;</td></tr>
<tr class="memdesc:ga45c4c964fad4ad1641d5c9c28c4645b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default mark for stack depth. <br /></td></tr>
<tr class="separator:ga45c4c964fad4ad1641d5c9c28c4645b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8564be479b948ee3052b61783c66d415"><td class="memItemLeft" align="right" valign="top">
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG</b>&#160;&#160;&#160;clutchlog::level::progress</td></tr>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DefaultConfigMacros.html#ga8564be479b948ee3052b61783c66d415">CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG</a>&#160;&#160;&#160;clutchlog::level::progress</td></tr>
<tr class="memdesc:ga8564be479b948ee3052b61783c66d415"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default level over which calls to the logger are optimized out when NDEBUG is defined. <br /></td></tr>
<tr class="separator:ga8564be479b948ee3052b61783c66d415"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae8911119d726a43b77f5781cb5a72813"><td class="memItemLeft" align="right" valign="top">
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>&#160;&#160;&#160;__FILE__, __FUNCTION__, __LINE__</td></tr>
@ -135,6 +137,9 @@ Macros</h2></td></tr>
<tr class="memitem:ga572e3aa19d8b39e3ed0b9e91961104c2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__UseMacros.html#ga572e3aa19d8b39e3ed0b9e91961104c2">CLUTCHDUMP</a>(LEVEL, CONTAINER, FILENAME)</td></tr>
<tr class="memdesc:ga572e3aa19d8b39e3ed0b9e91961104c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dump the given container. <a href="group__UseMacros.html#ga572e3aa19d8b39e3ed0b9e91961104c2">More...</a><br /></td></tr>
<tr class="separator:ga572e3aa19d8b39e3ed0b9e91961104c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9f77cee4f853e582262930c9c17f90ae"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__UseMacros.html#ga9f77cee4f853e582262930c9c17f90ae">CLUTCHFUNC</a>(LEVEL, FUNC, ...)</td></tr>
<tr class="memdesc:ga9f77cee4f853e582262930c9c17f90ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Call an assert at the given level. <a href="group__UseMacros.html#ga9f77cee4f853e582262930c9c17f90ae">More...</a><br /></td></tr>
<tr class="separator:ga9f77cee4f853e582262930c9c17f90ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->

File diff suppressed because one or more lines are too long

View file

@ -63,7 +63,7 @@ $(function() {
</div>
</div><!-- top -->
<div class="contents">
<h3>tests &rarr; clutchlog Relation</h3><table class="dirtab"><tr class="dirtab"><th class="dirtab">File in tests</th><th class="dirtab">Includes file in clutchlog</th></tr><tr class="dirtab"><td class="dirtab"><b>t-color.cpp</b></td><td class="dirtab"><a class="el" href="clutchlog_8h.html">clutchlog.h</a></td></tr><tr class="dirtab"><td class="dirtab"><b>t-demo.cpp</b></td><td class="dirtab"><a class="el" href="clutchlog_8h.html">clutchlog.h</a></td></tr><tr class="dirtab"><td class="dirtab"><b>t-dump.cpp</b></td><td class="dirtab"><a class="el" href="clutchlog_8h.html">clutchlog.h</a></td></tr><tr class="dirtab"><td class="dirtab"><b>t-log.cpp</b></td><td class="dirtab"><a class="el" href="clutchlog_8h.html">clutchlog.h</a></td></tr></table></div><!-- contents -->
<h3>tests &rarr; clutchlog Relation</h3><table class="dirtab"><tr class="dirtab"><th class="dirtab">File in tests</th><th class="dirtab">Includes file in clutchlog</th></tr><tr class="dirtab"><td class="dirtab"><b>t-assert.cpp</b></td><td class="dirtab"><a class="el" href="clutchlog_8h.html">clutchlog.h</a></td></tr><tr class="dirtab"><td class="dirtab"><b>t-color.cpp</b></td><td class="dirtab"><a class="el" href="clutchlog_8h.html">clutchlog.h</a></td></tr><tr class="dirtab"><td class="dirtab"><b>t-demo.cpp</b></td><td class="dirtab"><a class="el" href="clutchlog_8h.html">clutchlog.h</a></td></tr><tr class="dirtab"><td class="dirtab"><b>t-dump.cpp</b></td><td class="dirtab"><a class="el" href="clutchlog_8h.html">clutchlog.h</a></td></tr><tr class="dirtab"><td class="dirtab"><b>t-log.cpp</b></td><td class="dirtab"><a class="el" href="clutchlog_8h.html">clutchlog.h</a></td></tr></table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">

View file

@ -74,7 +74,7 @@ Directory dependency graph for tests:</div>
<map name="dir__59425e443f801f1f2fd8bbe4959a3ccf__dep" id="dir__59425e443f801f1f2fd8bbe4959a3ccf__dep">
<area shape="rect" id="node1" href="dir_59425e443f801f1f2fd8bbe4959a3ccf.html" title="tests" alt="" coords="7,5,79,53"/>
<area shape="rect" id="node2" href="dir_c318bd5cf14aaa5601e6029e0b5b4048.html" title="clutchlog" alt="" coords="5,101,80,149"/>
<area shape="rect" id="edge1-headlabel" href="dir_000036_000000.html" title="4" alt="" coords="47,75,55,90"/>
<area shape="rect" id="edge1-headlabel" href="dir_000036_000000.html" title="5" alt="" coords="47,75,55,90"/>
</map>
</div>
</div><!-- contents -->

View file

@ -1,5 +1,5 @@
<map id="tests" name="tests">
<area shape="rect" id="node1" href="dir_59425e443f801f1f2fd8bbe4959a3ccf.html" title="tests" alt="" coords="7,5,79,53"/>
<area shape="rect" id="node2" href="dir_c318bd5cf14aaa5601e6029e0b5b4048.html" title="clutchlog" alt="" coords="5,101,80,149"/>
<area shape="rect" id="edge1-headlabel" href="dir_000036_000000.html" title="4" alt="" coords="47,75,55,90"/>
<area shape="rect" id="edge1-headlabel" href="dir_000036_000000.html" title="5" alt="" coords="47,75,55,90"/>
</map>

View file

@ -1 +1 @@
a5f8fa0d7d58d59b863458f8c2f78e64
1952cc54af7dc9a50e1812305a9c5e50

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before After
Before After

View file

@ -69,12 +69,21 @@ $(function() {
<li>CLUTCHDUMP_DEFAULT_SEP
: <a class="el" href="group__DefaultConfigMacros.html#ga54d29e956575e1c731eab5406135c5df">clutchlog.h</a>
</li>
<li>CLUTCHFUNC
: <a class="el" href="group__UseMacros.html#ga9f77cee4f853e582262930c9c17f90ae">clutchlog.h</a>
</li>
<li>CLUTCHLOC
: <a class="el" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">clutchlog.h</a>
</li>
<li>CLUTCHLOG
: <a class="el" href="group__UseMacros.html#ga6f86187e2b35e7e1907d688f504a197d">clutchlog.h</a>
</li>
<li>CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG
: <a class="el" href="group__DefaultConfigMacros.html#ga8564be479b948ee3052b61783c66d415">clutchlog.h</a>
</li>
<li>CLUTCHLOG_DEFAULT_DEPTH_MARK
: <a class="el" href="group__DefaultConfigMacros.html#ga45c4c964fad4ad1641d5c9c28c4645b9">clutchlog.h</a>
</li>
<li>CLUTCHLOG_DEFAULT_FORMAT
: <a class="el" href="group__DefaultConfigMacros.html#ga524c16f280d92ee8ab683162c9ce01fa">clutchlog.h</a>
</li>

View file

@ -69,12 +69,21 @@ $(function() {
<li>CLUTCHDUMP_DEFAULT_SEP
: <a class="el" href="group__DefaultConfigMacros.html#ga54d29e956575e1c731eab5406135c5df">clutchlog.h</a>
</li>
<li>CLUTCHFUNC
: <a class="el" href="group__UseMacros.html#ga9f77cee4f853e582262930c9c17f90ae">clutchlog.h</a>
</li>
<li>CLUTCHLOC
: <a class="el" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">clutchlog.h</a>
</li>
<li>CLUTCHLOG
: <a class="el" href="group__UseMacros.html#ga6f86187e2b35e7e1907d688f504a197d">clutchlog.h</a>
</li>
<li>CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG
: <a class="el" href="group__DefaultConfigMacros.html#ga8564be479b948ee3052b61783c66d415">clutchlog.h</a>
</li>
<li>CLUTCHLOG_DEFAULT_DEPTH_MARK
: <a class="el" href="group__DefaultConfigMacros.html#ga45c4c964fad4ad1641d5c9c28c4645b9">clutchlog.h</a>
</li>
<li>CLUTCHLOG_DEFAULT_FORMAT
: <a class="el" href="group__DefaultConfigMacros.html#ga524c16f280d92ee8ab683162c9ce01fa">clutchlog.h</a>
</li>

View file

@ -81,10 +81,12 @@ Macros</h2></td></tr>
<tr class="memdesc:ga54d29e956575e1c731eab5406135c5df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default item separator for dump. <br /></td></tr>
<tr class="separator:ga54d29e956575e1c731eab5406135c5df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga45c4c964fad4ad1641d5c9c28c4645b9"><td class="memItemLeft" align="right" valign="top"><a id="ga45c4c964fad4ad1641d5c9c28c4645b9"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CLUTCHLOG_DEFAULT_DEPTH_MARK</b>&#160;&#160;&#160;&quot;&gt;&quot;</td></tr>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DefaultConfigMacros.html#ga45c4c964fad4ad1641d5c9c28c4645b9">CLUTCHLOG_DEFAULT_DEPTH_MARK</a>&#160;&#160;&#160;&quot;&gt;&quot;</td></tr>
<tr class="memdesc:ga45c4c964fad4ad1641d5c9c28c4645b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default mark for stack depth. <br /></td></tr>
<tr class="separator:ga45c4c964fad4ad1641d5c9c28c4645b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8564be479b948ee3052b61783c66d415"><td class="memItemLeft" align="right" valign="top"><a id="ga8564be479b948ee3052b61783c66d415"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG</b>&#160;&#160;&#160;clutchlog::level::progress</td></tr>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DefaultConfigMacros.html#ga8564be479b948ee3052b61783c66d415">CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG</a>&#160;&#160;&#160;clutchlog::level::progress</td></tr>
<tr class="memdesc:ga8564be479b948ee3052b61783c66d415"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default level over which calls to the logger are optimized out when NDEBUG is defined. <br /></td></tr>
<tr class="separator:ga8564be479b948ee3052b61783c66d415"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>

View file

@ -78,6 +78,9 @@ Macros</h2></td></tr>
<tr class="memitem:ga572e3aa19d8b39e3ed0b9e91961104c2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__UseMacros.html#ga572e3aa19d8b39e3ed0b9e91961104c2">CLUTCHDUMP</a>(LEVEL, CONTAINER, FILENAME)</td></tr>
<tr class="memdesc:ga572e3aa19d8b39e3ed0b9e91961104c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dump the given container. <a href="#ga572e3aa19d8b39e3ed0b9e91961104c2">More...</a><br /></td></tr>
<tr class="separator:ga572e3aa19d8b39e3ed0b9e91961104c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9f77cee4f853e582262930c9c17f90ae"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__UseMacros.html#ga9f77cee4f853e582262930c9c17f90ae">CLUTCHFUNC</a>(LEVEL, FUNC, ...)</td></tr>
<tr class="memdesc:ga9f77cee4f853e582262930c9c17f90ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Call an assert at the given level. <a href="#ga9f77cee4f853e582262930c9c17f90ae">More...</a><br /></td></tr>
<tr class="separator:ga9f77cee4f853e582262930c9c17f90ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
@ -112,12 +115,50 @@ Macros</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line"> auto&amp; logger = <a class="code" href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a>(); \</div><div class="line"> logger.dump(clutchlog::level::LEVEL, std::begin(CONTAINER), std::end(CONTAINER), \</div><div class="line"> <a class="code" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>, FILENAME, <a class="code" href="group__DefaultConfigMacros.html#ga54d29e956575e1c731eab5406135c5df">CLUTCHDUMP_DEFAULT_SEP</a>); \</div><div class="line">}</div><div class="ttc" id="group__UseMacros_html_gae8911119d726a43b77f5781cb5a72813"><div class="ttname"><a href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a></div><div class="ttdeci">#define CLUTCHLOC</div><div class="ttdoc">Handy shortcuts to location. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:81</div></div>
<div class="ttc" id="classclutchlog_html_acfaceb77da01503b432644a3efaee4fa"><div class="ttname"><a href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a></div><div class="ttdeci">static clutchlog &amp; logger()</div><div class="ttdoc">Get the logger instance. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:149</div></div>
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line"> auto&amp; logger = <a class="code" href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a>(); \</div><div class="line"> logger.dump(clutchlog::level::LEVEL, std::begin(CONTAINER), std::end(CONTAINER), \</div><div class="line"> <a class="code" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>, FILENAME, <a class="code" href="group__DefaultConfigMacros.html#ga54d29e956575e1c731eab5406135c5df">CLUTCHDUMP_DEFAULT_SEP</a>); \</div><div class="line">}</div><div class="ttc" id="group__UseMacros_html_gae8911119d726a43b77f5781cb5a72813"><div class="ttname"><a href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a></div><div class="ttdeci">#define CLUTCHLOC</div><div class="ttdoc">Handy shortcuts to location. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:83</div></div>
<div class="ttc" id="classclutchlog_html_acfaceb77da01503b432644a3efaee4fa"><div class="ttname"><a href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a></div><div class="ttdeci">static clutchlog &amp; logger()</div><div class="ttdoc">Get the logger instance. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:165</div></div>
<div class="ttc" id="group__DefaultConfigMacros_html_ga54d29e956575e1c731eab5406135c5df"><div class="ttname"><a href="group__DefaultConfigMacros.html#ga54d29e956575e1c731eab5406135c5df">CLUTCHDUMP_DEFAULT_SEP</a></div><div class="ttdeci">#define CLUTCHDUMP_DEFAULT_SEP</div><div class="ttdoc">Default item separator for dump. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:64</div></div>
</div><!-- fragment -->
<p>Dump the given container. </p>
</div>
</div>
<a id="ga9f77cee4f853e582262930c9c17f90ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9f77cee4f853e582262930c9c17f90ae">&#9670;&nbsp;</a></span>CLUTCHFUNC</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CLUTCHFUNC</td>
<td>(</td>
<td class="paramtype">&#160;</td>
<td class="paramname">LEVEL, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname">FUNC, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&#160;</td>
<td class="paramname"><em>...</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line"> auto&amp; logger = <a class="code" href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a>(); \</div><div class="line"> clutchlog::scope_t scope = logger.locate(clutchlog::level::LEVEL, <a class="code" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>); \</div><div class="line"> if(scope.matches) { \</div><div class="line"> FUNC(__VA_ARGS__); \</div><div class="line"> } \</div><div class="line">}</div><div class="ttc" id="group__UseMacros_html_gae8911119d726a43b77f5781cb5a72813"><div class="ttname"><a href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a></div><div class="ttdeci">#define CLUTCHLOC</div><div class="ttdoc">Handy shortcuts to location. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:83</div></div>
<div class="ttc" id="classclutchlog_html_acfaceb77da01503b432644a3efaee4fa"><div class="ttname"><a href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a></div><div class="ttdeci">static clutchlog &amp; logger()</div><div class="ttdoc">Get the logger instance. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:165</div></div>
</div><!-- fragment -->
<p>Call an assert at the given level. </p>
</div>
</div>
<a id="ga6f86187e2b35e7e1907d688f504a197d"></a>
@ -145,8 +186,8 @@ Macros</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line"> auto&amp; logger = <a class="code" href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a>(); \</div><div class="line"> std::ostringstream msg ; msg &lt;&lt; WHAT; \</div><div class="line"> logger.log(clutchlog::level::LEVEL, msg.str(), <a class="code" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>); \</div><div class="line">}</div><div class="ttc" id="group__UseMacros_html_gae8911119d726a43b77f5781cb5a72813"><div class="ttname"><a href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a></div><div class="ttdeci">#define CLUTCHLOC</div><div class="ttdoc">Handy shortcuts to location. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:81</div></div>
<div class="ttc" id="classclutchlog_html_acfaceb77da01503b432644a3efaee4fa"><div class="ttname"><a href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a></div><div class="ttdeci">static clutchlog &amp; logger()</div><div class="ttdoc">Get the logger instance. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:149</div></div>
<b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line"> auto&amp; logger = <a class="code" href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a>(); \</div><div class="line"> std::ostringstream msg ; msg &lt;&lt; WHAT; \</div><div class="line"> logger.log(clutchlog::level::LEVEL, msg.str(), <a class="code" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>); \</div><div class="line">}</div><div class="ttc" id="group__UseMacros_html_gae8911119d726a43b77f5781cb5a72813"><div class="ttname"><a href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a></div><div class="ttdeci">#define CLUTCHLOC</div><div class="ttdoc">Handy shortcuts to location. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:83</div></div>
<div class="ttc" id="classclutchlog_html_acfaceb77da01503b432644a3efaee4fa"><div class="ttname"><a href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a></div><div class="ttdeci">static clutchlog &amp; logger()</div><div class="ttdoc">Get the logger instance. </div><div class="ttdef"><b>Definition:</b> clutchlog.h:165</div></div>
</div><!-- fragment -->
<p>Log a message at the given level. </p>

View file

@ -73,23 +73,31 @@ $(function() {
<li class="level2"><a href="#autotoc_md7">Output style</a></li>
<li class="level2"><a href="#autotoc_md8">Disabled calls</a></li>
<li class="level2"><a href="#autotoc_md9">Low-level API</a></li>
<li class="level2"><a href="#autotoc_md10">(De)clutch any function call</a></li>
</ul>
</li>
<li class="level1"><a href="#autotoc_md10">Log level semantics</a></li>
<li class="level1"><a href="#autotoc_md11">Limitations</a></li>
<li class="level1"><a href="#autotoc_md12">Build and tests</a></li>
<li class="level1"><a href="#autotoc_md11">Log level semantics</a></li>
<li class="level1"><a href="#autotoc_md12">Limitations</a></li>
<li class="level1"><a href="#autotoc_md13">Build and tests</a></li>
</ul>
</div>
<div class="textblock"><p><b>Clutchlog is a logging system which targets versatile debugging.</b> <b>It allows to (de)clutch messages for a given: log level, source code location or call stack depth.</b></p>
<div class="textblock"><p><em><b>Clutchlog is a logging system which targets versatile debugging.</b></em> <em><b>It allows to (de)clutch messages for a given: log level, source code location or call stack depth.</b></em></p>
<h1><a class="anchor" id="autotoc_md0"></a>
Features</h1>
<p>Clutchlog allows to select which log messages will be displayed, based on their locations:</p>
<ul>
<li><em>classical log levels</em>: each message has a given detail level and it is displayed if you ask for a at least the same one.</li>
<li><em>call stack depth</em>: you can ask to display messages within functions which are called up to a given stack depth.</li>
<li><em>source code location</em>: you can ask to display messages called from given files, functions and line number, all based on regular expressions.</li>
<li><b>Classical log levels</b>: each message has a given detail level and it is displayed if you ask for a at least the same one.</li>
<li><b>Call stack depth</b>: you can ask to display messages within functions which are called up to a given stack depth.</li>
<li><b>Source code location</b>: you can ask to display messages called from given files, functions and line number, all based on regular expressions.</li>
</ul>
<p>Additionally, Clutchlog will do its best to allow the compiler to optimize out calls, for instance debug messages in "Release" builds.</p>
<p>Additional features:</p>
<ul>
<li><b>Templated log format</b>, to easily design your own format.</li>
<li><b>Colored log</b>. By default only important ones are colored (critical and error in red, warning in magenta).</li>
<li><b>Macro to dump the content of a container in a file</b> with automatic naming (yes, it is useful for fast debugging).</li>
<li><b>Generic clutching wrapper</b>, to wrap any function call. Useful to (de)clutch <em>asserts</em> for example.</li>
</ul>
<h1><a class="anchor" id="autotoc_md1"></a>
Example</h1>
<p>Adding a message is a simple as calling a macro (which is declutched in Debug build type, when <code>NDEBUG</code> is not defined): </p><div class="fragment"><div class="line"><a class="code" href="group__UseMacros.html#ga6f86187e2b35e7e1907d688f504a197d">CLUTCHLOG</a>(info, <span class="stringliteral">&quot;matrix size: &quot;</span> &lt;&lt; m &lt;&lt; <span class="stringliteral">&quot;x&quot;</span> &lt;&lt; n);</div></div><!-- fragment --><p>To configure the display, you indicate the three types of locations, for example in your <code>main</code> function: </p><div class="fragment"><div class="line"><span class="keyword">auto</span>&amp; log = <a class="code" href="classclutchlog.html#acfaceb77da01503b432644a3efaee4fa">clutchlog::logger</a>();</div><div class="line">log.depth(2); <span class="comment">// Log functions called from &quot;main&quot; but not below.</span></div><div class="line">log.threshold(clutchlog::level::info); <span class="comment">// Log only &quot;info&quot;, &quot;warning&quot;, &quot;error&quot; or &quot;critical&quot; messages.</span></div><div class="line">log.file(<span class="stringliteral">&quot;algebra/.*&quot;</span>); <span class="comment">// Will match any file in the &quot;algebra&quot; directory.</span></div><div class="line">log.func(<span class="stringliteral">&quot;(mul|add|sub|div)&quot;</span>); <span class="comment">// Will match &quot;multiply&quot;, for instance.</span></div></div><!-- fragment --><p>For more detailled examples, see the "API documentation" section below and the <code>tests</code> directory.</p>
@ -123,7 +131,7 @@ Output Configuration</h2>
</ul>
<p>The default log format is <code>"[{name}] {level_letter}:{depth_marks} {msg}\t\t\t\t\t{func} @ {file}:{line}\n"</code>, it can be overriden at compile time by defining the <code>CLUTCHLOG_DEFAULT_FORMAT</code> macro.</p>
<p>The default format of the comment added with the dump macro is <code>"# [{name}] {level} in {func} (at depth {depth}) @ {file}:{line}"</code>. It can be edited with the <code>format_comment</code> method. If it is set to an empty string, then no comment line is added. The default can be modified at compile time with <code>CLUTCHDUMP_DEFAULT_FORMAT</code>. By default, the separator between items in the container is a new line. To change this behaviour, you can change <code>CLUTCHDUMP_DEFAULT_SEP</code> or call the low-level <code>dump</code> method.</p>
<p>The mark used with the <code>{depth_marks}</code> tag can be configured with the <code>depth_mark</code> method, and its default with the <code>CLUTCHLOG_DEFAULT_DEPTH_MARK</code> macro: </p><div class="fragment"><div class="line">log.depth_mark(CLUTCHLOG_DEFAULT_DEPTH_MARK); <span class="comment">// Defaults to &quot;&gt;&quot;.</span></div></div><!-- fragment --><h2><a class="anchor" id="autotoc_md7"></a>
<p>The mark used with the <code>{depth_marks}</code> tag can be configured with the <code>depth_mark</code> method, and its default with the <code>CLUTCHLOG_DEFAULT_DEPTH_MARK</code> macro: </p><div class="fragment"><div class="line">log.depth_mark(<a class="code" href="group__DefaultConfigMacros.html#ga45c4c964fad4ad1641d5c9c28c4645b9">CLUTCHLOG_DEFAULT_DEPTH_MARK</a>); <span class="comment">// Defaults to &quot;&gt;&quot;.</span></div></div><!-- fragment --><h2><a class="anchor" id="autotoc_md7"></a>
Output style</h2>
<p>The output can be colored differently depending on the log level. </p><div class="fragment"><div class="line"><span class="comment">// Print error messages in bold red:</span></div><div class="line">log.style(clutchlog::level::error, <span class="comment">// First, the log level.</span></div><div class="line"> clutchlog::fmt::fg::red, <span class="comment">// Then the styles, in any order...</span></div><div class="line"> clutchlog::fmt::typo::bold);</div></div><!-- fragment --><p>Or, if you want to declare some semantics beforehand: </p><div class="fragment"><div class="line"><span class="comment">// Print warning messages in bold magenta:</span></div><div class="line"><span class="keyword">using</span> fmt = <a class="code" href="classclutchlog_1_1fmt.html">clutchlog::fmt</a>;</div><div class="line">fmt warn(fmt::fg::magenta, fmt::typo::bold);</div><div class="line">log.style(clutchlog::level::warning, warn);</div></div><!-- fragment --><p>Using the <code><a class="el" href="classclutchlog_1_1fmt.html" title="Color and style formatter for ANSI terminal escape sequences. ">clutchlog::fmt</a></code> class, you can style:</p>
<ul>
@ -162,7 +170,11 @@ Disabled calls</h2>
<p>This behavior intend to remove as many conditional statements as possible when not debugging, without having to use preprocessor guards around calls to clutchlog, thus saving run time at no readability cost.</p>
<h2><a class="anchor" id="autotoc_md9"></a>
Low-level API</h2>
<p>All configuration setters have a getters counterpart, with the same name but taking no parameter, for example: </p><div class="fragment"><div class="line">std::string mark = log.depth_mark();</div></div><!-- fragment --><p>To control more precisely the logging, one can use the low-level <code>log</code> method: </p><div class="fragment"><div class="line">log.log(clutchlog::level::xdebug, <span class="stringliteral">&quot;hello world&quot;</span>, <span class="stringliteral">&quot;main.cpp&quot;</span>, <span class="stringliteral">&quot;main&quot;</span>, 122);</div></div><!-- fragment --><p> A helper macro can helps to fill in the location with the actual one, as seen by the compiler: </p><div class="fragment"><div class="line">log.log(clutchlog::level::xdebug, <span class="stringliteral">&quot;hello world&quot;</span>, <a class="code" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>);</div></div><!-- fragment --><p> A similar <code>dump</code> method exists: </p><div class="fragment"><div class="line">log.dump(clutchlog::level::xdebug, cont.begin(), cont.end(), <a class="code" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>, <span class="stringliteral">&quot;dumped_{n}.dat&quot;</span>, <span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line">log.dump(clutchlog::level::xdebug, cont.begin(), cont.end(), <span class="stringliteral">&quot;main.cpp&quot;</span>, <span class="stringliteral">&quot;main&quot;</span>, 122, <span class="stringliteral">&quot;dumped.dat&quot;</span>, <span class="stringliteral">&quot;\n\n&quot;</span>);</div></div><!-- fragment --><h1><a class="anchor" id="autotoc_md10"></a>
<p>All configuration setters have a getters counterpart, with the same name but taking no parameter, for example: </p><div class="fragment"><div class="line">std::string mark = log.depth_mark();</div></div><!-- fragment --><p>To control more precisely the logging, one can use the low-level <code>log</code> method: </p><div class="fragment"><div class="line">log.log(clutchlog::level::xdebug, <span class="stringliteral">&quot;hello world&quot;</span>, <span class="stringliteral">&quot;main.cpp&quot;</span>, <span class="stringliteral">&quot;main&quot;</span>, 122);</div></div><!-- fragment --><p> A helper macro can helps to fill in the location with the actual one, as seen by the compiler: </p><div class="fragment"><div class="line">log.log(clutchlog::level::xdebug, <span class="stringliteral">&quot;hello world&quot;</span>, <a class="code" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>);</div></div><!-- fragment --><p> A similar <code>dump</code> method exists: </p><div class="fragment"><div class="line">log.dump(clutchlog::level::xdebug, cont.begin(), cont.end(), <a class="code" href="group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813">CLUTCHLOC</a>, <span class="stringliteral">&quot;dumped_{n}.dat&quot;</span>, <span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line">log.dump(clutchlog::level::xdebug, cont.begin(), cont.end(), <span class="stringliteral">&quot;main.cpp&quot;</span>, <span class="stringliteral">&quot;main&quot;</span>, 122, <span class="stringliteral">&quot;dumped.dat&quot;</span>, <span class="stringliteral">&quot;\n\n&quot;</span>);</div></div><!-- fragment --><h2><a class="anchor" id="autotoc_md10"></a>
(De)clutch any function call</h2>
<p>The <code>CLUTHFUNC</code> macro allows to wrap any function within the current logger.</p>
<p>For instance, this can be useful if you want to (de)clutch calls to <code>assert</code>s. To do that, just declare your own macro: </p><div class="fragment"><div class="line"><span class="preprocessor">#define ASSERT(LEVEL, ...) { CLUTCHFUNC(LEVEL, assert, __VA_ARGS__) }</span></div></div><!-- fragment --><p> Thus, any call like <code>ASSERT(error, x &gt; 3);</code> will be declutchable with the same configuration than a call to <code>CLUTCHLOG</code>.</p>
<h1><a class="anchor" id="autotoc_md11"></a>
Log level semantics</h1>
<p>Log levels use a classical semantics for a human skilled in the art, in decreasing order of importance:</p>
<ul>
@ -176,12 +188,26 @@ Log level semantics</h1>
<li><em>XDebug</em>: debugging information which would be heavy to read.</li>
</ul>
<p>Note: the log levels constants are lower case (for example: <code>clutchlog::level::xdebug</code>), but their string representation is not (e.g. "XDebug", this should be taken into account when using <code>level_of</code>).</p>
<h1><a class="anchor" id="autotoc_md11"></a>
<h1><a class="anchor" id="autotoc_md12"></a>
Limitations</h1>
<p>Because the call stack depth and program name access are system-dependent, the features relying on the depth of the call stack and the display of the program name are only available for operating systems having the following headers: <code>execinfo.h</code>, <code>stdlib.h</code> and <code>libgen.h</code> (so far, tested with Linux).</p>
<p>Some colors/styles may not be supported by some exotic terminal emulators.</p>
<p>Clutchlog needs <code>C++-17</code> with the <code>filesystem</code> feature. You may need to indicate <code>-std=c++17 -lstdc++fs</code> to your compiler.</p>
<h1><a class="anchor" id="autotoc_md12"></a>
<p>Clutchlog needs <code>C++-17</code> with the <code>filesystem</code> feature. You may need to indicate <code>-std=c++17 -lstdc++fs</code> to some compilers.</p>
<p>What Clutchlog do not provide at the moment (but may in a near future):</p>
<ul>
<li>Super fast log writing.</li>
<li>Thread safety.</li>
</ul>
<p>What Clutchlog will most certainly never provide:</p>
<ul>
<li>Round-robin log managers.</li>
<li>Duplicated messages management.</li>
<li>External output systems (only allow output stream, you can still do the proxy yourself).</li>
<li>External error handlers (not my job, come on).</li>
<li>Automatic argument parser (please, use a dedicated lib).</li>
<li>Signal handling (WTF would you do that, anyway?).</li>
</ul>
<h1><a class="anchor" id="autotoc_md13"></a>
Build and tests</h1>
<p>To use clutchlog, just include its header in your code and either ensure that the <code>NDEBUG</code> preprocessor variable is not set, either define the <code>WITH_CLUTCHLOG</code> preprocessor variable.</p>
<p>If you're using CMake (or another modern build system), it will unset <code>NDEBUG</code> —and thus enable clutchlog— only for the "Debug" build type, which is usually what you want if you use clutchlog, anyway.</p>

View file

@ -3,8 +3,11 @@ var searchData=
['clutchdump',['CLUTCHDUMP',['../group__UseMacros.html#ga572e3aa19d8b39e3ed0b9e91961104c2',1,'clutchlog.h']]],
['clutchdump_5fdefault_5fformat',['CLUTCHDUMP_DEFAULT_FORMAT',['../group__DefaultConfigMacros.html#ga27b613c6727857a7cbcd0165d862034e',1,'clutchlog.h']]],
['clutchdump_5fdefault_5fsep',['CLUTCHDUMP_DEFAULT_SEP',['../group__DefaultConfigMacros.html#ga54d29e956575e1c731eab5406135c5df',1,'clutchlog.h']]],
['clutchfunc',['CLUTCHFUNC',['../group__UseMacros.html#ga9f77cee4f853e582262930c9c17f90ae',1,'clutchlog.h']]],
['clutchloc',['CLUTCHLOC',['../group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813',1,'clutchlog.h']]],
['clutchlog',['clutchlog',['../classclutchlog.html',1,'clutchlog'],['../group__UseMacros.html#ga6f86187e2b35e7e1907d688f504a197d',1,'CLUTCHLOG():&#160;clutchlog.h']]],
['clutchlog_2eh',['clutchlog.h',['../clutchlog_8h.html',1,'']]],
['clutchlog_5fdefault_5fdepth_5fbuilt_5fnodebug',['CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG',['../group__DefaultConfigMacros.html#ga8564be479b948ee3052b61783c66d415',1,'clutchlog.h']]],
['clutchlog_5fdefault_5fdepth_5fmark',['CLUTCHLOG_DEFAULT_DEPTH_MARK',['../group__DefaultConfigMacros.html#ga45c4c964fad4ad1641d5c9c28c4645b9',1,'clutchlog.h']]],
['clutchlog_5fdefault_5fformat',['CLUTCHLOG_DEFAULT_FORMAT',['../group__DefaultConfigMacros.html#ga524c16f280d92ee8ab683162c9ce01fa',1,'clutchlog.h']]]
];