Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-release > by-pkgid > abaab48f26603db3a2bcf7befcb26cf3 > files > 77

lib64rlog-devel-1.4-9.mga6.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>rlog: rlog.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.0 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="annotated.html"><span>Classes</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul></div>
<h1>rlog.h File Reference</h1>Defines macros for debug, warning, and error messages. <a href="#_details">More...</a>
<p>
<code>#include &lt;rlog/common.h&gt;</code><br>
<code>#include &lt;rlog/rlog-c99.h&gt;</code><br>

<p>
<a href="rlog_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Namespaces</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">namespace &nbsp;</td><td class="memItemRight" valign="bottom"><b>rlog</b></td></tr>

<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrlog_1_1PublishLoc.html">rlog::PublishLoc</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Internal RLog structure - static struct for each <a class="el" href="group__RLogMacros.html#g95004cecec660f509c3e9af03608aa7d">rLog()</a> statement.  <a href="structrlog_1_1PublishLoc.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="38ba2770a67d7c4b4b1a81e2f9062369"></a><!-- doxytag: member="rlog.h::CONCAT2" ref="38ba2770a67d7c4b4b1a81e2f9062369" args="(A, B)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>CONCAT2</b>(A, B)&nbsp;&nbsp;&nbsp;A##B</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0feb7e0b940efad526132db03f9febf9"></a><!-- doxytag: member="rlog.h::CONCAT" ref="0feb7e0b940efad526132db03f9febf9" args="(A, B)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>CONCAT</b>(A, B)&nbsp;&nbsp;&nbsp;CONCAT2(A,B)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ae57f17e11e61cf0519e2004414f5629"></a><!-- doxytag: member="rlog.h::STR" ref="ae57f17e11e61cf0519e2004414f5629" args="(X)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>STR</b>(X)&nbsp;&nbsp;&nbsp;#X</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5b7c18701ae1346168a6fdf4e2a65918"></a><!-- doxytag: member="rlog.h::CURRENT_RLOG_VERSION" ref="5b7c18701ae1346168a6fdf4e2a65918" args="" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>CURRENT_RLOG_VERSION</b>&nbsp;&nbsp;&nbsp;20040503</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="rlog_8h.html#ae55883696f0d46d890824be09d70d5d">DEF_CHANNEL</a>(path, level)&nbsp;&nbsp;&nbsp;RLOG_CHANNEL_IMPL(RLOG_COMPONENT, path, level)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns pointer to RLogChannel struct for the given path.  <a href="#ae55883696f0d46d890824be09d70d5d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5fb9cc2a408344e70767621ac8a0b129"></a><!-- doxytag: member="rlog.h::RLOG_CHANNEL" ref="5fb9cc2a408344e70767621ac8a0b129" args="(path)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>RLOG_CHANNEL</b>(path)&nbsp;&nbsp;&nbsp;RLOG_CHANNEL_IMPL(RLOG_COMPONENT, path, rlog::Log_Undef)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d5b1a8a2559a0e99c92019e08bc40619"></a><!-- doxytag: member="rlog.h::RLOG_CHANNEL_IMPL" ref="d5b1a8a2559a0e99c92019e08bc40619" args="(COMPONENT, path, level)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>RLOG_CHANNEL_IMPL</b>(COMPONENT, path, level)&nbsp;&nbsp;&nbsp;rlog::GetComponentChannel(STR(COMPONENT),path,level)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="679fde788c8cc482bee5e1ae9b3cf3b3"></a><!-- doxytag: member="rlog.h::_rAssertFailed" ref="679fde788c8cc482bee5e1ae9b3cf3b3" args="(COMPONENT, COND)" -->
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>_rAssertFailed</b>(COMPONENT, COND)&nbsp;&nbsp;&nbsp;rlog::rAssertFailed(STR(COMPONENT),__FILE__,__FUNCTION__,__LINE__, COND)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="rlog_8h.html#964127b894c48e2d41a5e6bdbcc3455b">rAssert</a>(cond)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assert condition - throws error if <em>cond</em> evaluates to false.  <a href="#964127b894c48e2d41a5e6bdbcc3455b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="rlog_8h.html#ff23c3efdd657d856c9d12b0ef8e746b">rAssertSilent</a>(cond)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assert condition - throws error if <em>cond</em> evaluates to false, but does not display error message.  <a href="#ff23c3efdd657d856c9d12b0ef8e746b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>RLOG_NO_COPY</b>(CNAME)</td></tr>

<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><b>LogLevel</b> { <br>
&nbsp;&nbsp;<a class="el" href="namespacerlog.html#022427023252f04c663a5bb6c1e2ecdebdda2cd56deefcfd250952939aebd55e">rlog::Log_Undef</a> = 0, 
<a class="el" href="namespacerlog.html#022427023252f04c663a5bb6c1e2ecde5e0fcc7ff18c40400e80de172eb20251">rlog::Log_Critical</a>, 
<a class="el" href="namespacerlog.html#022427023252f04c663a5bb6c1e2ecdeba05ee4aed9cf034b9c5eda9c60ce728">rlog::Log_Error</a>, 
<a class="el" href="namespacerlog.html#022427023252f04c663a5bb6c1e2ecdecaa3d6f0315f43b4a4517dbf124cf8ea">rlog::Log_Warning</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="namespacerlog.html#022427023252f04c663a5bb6c1e2ecdee0072ecef71cb42fcac3d821269ff4eb">rlog::Log_Notice</a>, 
<a class="el" href="namespacerlog.html#022427023252f04c663a5bb6c1e2ecdeff201ec106cd87302dba134a329927d1">rlog::Log_Info</a>, 
<a class="el" href="namespacerlog.html#022427023252f04c663a5bb6c1e2ecdea704593fd28e563953741ea262a7cb35">rlog::Log_Debug</a>
<br>
 }</td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a41ad6468484a72a8da69e1751ae7cf6"></a><!-- doxytag: member="rlog.h::RLogVersion" ref="a41ad6468484a72a8da69e1751ae7cf6" args="()" -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><b>RLogVersion</b> ()</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void RLOG_DECL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacerlog.html#45e61a14d34904bd8d490ed231aeb6e8">rlog::RLogInit</a> (int &amp;argc, char **argv)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializer for external rlog modules.  <a href="#45e61a14d34904bd8d490ed231aeb6e8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4fedc39fe9aaa175de888e25053afe3f"></a><!-- doxytag: member="rlog.h::GetComponentChannel" ref="4fedc39fe9aaa175de888e25053afe3f" args="(const char *component, const char *path, LogLevel level=Log_Undef)" -->
RLOG_DECL RLogChannel *&nbsp;</td><td class="memItemRight" valign="bottom"><b>rlog::GetComponentChannel</b> (const char *component, const char *path, LogLevel level=Log_Undef)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="84a087c071ec7c0f7e78ca42647378ab"></a><!-- doxytag: member="rlog.h::GetGlobalChannel" ref="84a087c071ec7c0f7e78ca42647378ab" args="(const char *path, LogLevel level=Log_Undef)" -->
RLOG_DECL RLogChannel *&nbsp;</td><td class="memItemRight" valign="bottom"><b>rlog::GetGlobalChannel</b> (const char *path, LogLevel level=Log_Undef)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="239860e97bb7e227e6d5a8e25a4e2209"></a><!-- doxytag: member="rlog.h::RLog_Register" ref="239860e97bb7e227e6d5a8e25a4e2209" args="(PublishLoc *loc, RLogChannel *channel, const char *format,...)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>rlog::RLog_Register</b> (<a class="el" href="structrlog_1_1PublishLoc.html">PublishLoc</a> *loc, <a class="el" href="classrlog_1_1RLogChannel.html">RLogChannel</a> *channel, const char *format,...)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fc9a9b468f460e4aec0593450168871a"></a><!-- doxytag: member="rlog.h::rAssertFailed" ref="fc9a9b468f460e4aec0593450168871a" args="(const char *component, const char *file, const char *function, int line, const char *conditionStr)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>rlog::rAssertFailed</b> (const char *component, const char *file, const char *function, int line, const char *conditionStr)</td></tr>

<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="68f24caff1157f6dd841dbdf7cf262bc"></a><!-- doxytag: member="rlog.h::_RLDebugChannel" ref="68f24caff1157f6dd841dbdf7cf262bc" args="" -->
RLOG_DECL <a class="el" href="classrlog_1_1RLogChannel.html">RLogChannel</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><b>rlog::_RLDebugChannel</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="71c3d8d8efd4fbd10c00f49d79199d59"></a><!-- doxytag: member="rlog.h::_RLInfoChannel" ref="71c3d8d8efd4fbd10c00f49d79199d59" args="" -->
RLOG_DECL <a class="el" href="classrlog_1_1RLogChannel.html">RLogChannel</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><b>rlog::_RLInfoChannel</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9f201da2b18eca2dc9eaccf0ca576434"></a><!-- doxytag: member="rlog.h::_RLWarningChannel" ref="9f201da2b18eca2dc9eaccf0ca576434" args="" -->
RLOG_DECL <a class="el" href="classrlog_1_1RLogChannel.html">RLogChannel</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><b>rlog::_RLWarningChannel</b></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="14dde3b23ffb6fa9b53c0192bd3256d4"></a><!-- doxytag: member="rlog.h::_RLErrorChannel" ref="14dde3b23ffb6fa9b53c0192bd3256d4" args="" -->
RLOG_DECL <a class="el" href="classrlog_1_1RLogChannel.html">RLogChannel</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><b>rlog::_RLErrorChannel</b></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Defines macros for debug, warning, and error messages. 
<p>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="ae55883696f0d46d890824be09d70d5d"></a><!-- doxytag: member="rlog.h::DEF_CHANNEL" ref="ae55883696f0d46d890824be09d70d5d" args="(path, level)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DEF_CHANNEL          </td>
          <td>(</td>
          <td class="paramtype">path,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">level&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;RLOG_CHANNEL_IMPL(RLOG_COMPONENT, path, level)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns pointer to RLogChannel struct for the given path. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>path</em>&nbsp;</td><td>The hierarchical path to the channel. Elements in the path are separated by '/'.</td></tr>
  </table>
</dl>
DEF_CHANNEL gets an existing (or defines a new) log type. For example "debug", "warning", "error" are predefined types. You might define completely new types, like "timing", or perhaps sub-types like "debug/timing/foo", depending on your needs.<p>
Reporting paths do not need to be unique within a project (or even a file).<p>
Channels form a hierarchy. If one subscribes to "debug", then you also get messages posted to more specific types such as "debug/foo". But if you subscribe to a more specific type, such as "debug/foo", then you will not receive more general messages such as to "debug".<p>
Example: <div class="fragment"><pre class="fragment"><span class="preprocessor">      #include &lt;<a class="code" href="rlog_8h.html">rlog/rlog.h</a>&gt;</span>
<span class="preprocessor">      #include &lt;rlog/RLogChannel.h&gt;</span>

      <span class="keyword">static</span> RLogChannel *MyChannel = <a class="code" href="rlog_8h.html#ae55883696f0d46d890824be09d70d5d">DEF_CHANNEL</a>(<span class="stringliteral">"me/mine/allmine"</span>,Log_Info);

      func()
      {
          <a class="code" href="group__RLogMacros.html#g95004cecec660f509c3e9af03608aa7d">rLog</a>( MyChannel, <span class="stringliteral">"this is being sent to my own channel"</span> );
          <a class="code" href="group__RLogMacros.html#g95004cecec660f509c3e9af03608aa7d">rLog</a>( MyChannel, <span class="stringliteral">"%s %s"</span>, <span class="stringliteral">"hello"</span>, <span class="stringliteral">"world"</span> );
      }

      main()
      {
          <span class="comment">// log all messages to the "me" channel to stderr</span>
          StdioNode stdLog( STDERR_FILENO );
          stdLog.subscribeTo( RLOG_CHANNEL (<span class="stringliteral">"me"</span>) );

          func();
      }
</pre></div><p>
<dl class="see" compact><dt><b>See also:</b></dt><dd>test.cpp </dd></dl>

</div>
</div><p>
<a class="anchor" name="964127b894c48e2d41a5e6bdbcc3455b"></a><!-- doxytag: member="rlog.h::rAssert" ref="964127b894c48e2d41a5e6bdbcc3455b" args="(cond)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define rAssert          </td>
          <td>(</td>
          <td class="paramtype">cond&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
        <span class="keywordflow">if</span>( unlikely((cond) == <span class="keyword">false</span>) ) \
        { <a class="code" href="group__RLogMacros.html#gc31d5e1de248b22df42a34e58a2b7349">rError</a>( <span class="stringliteral">"Assert failed: "</span> STR(cond) ); \
          _rAssertFailed(RLOG_COMPONENT, STR(cond)); \
        } \
    } <span class="keywordflow">while</span>(0)
</pre></div>Assert condition - throws error if <em>cond</em> evaluates to false. 
<p>
Assert error condition. Displays error message if condition does not evaluate to TRUE.<p>
We throw an error from rAssertFailed. It isn't done inline so that we don't have to include the STL exception code here and bloat callers that don't use it or don't care. 
</div>
</div><p>
<a class="anchor" name="ff23c3efdd657d856c9d12b0ef8e746b"></a><!-- doxytag: member="rlog.h::rAssertSilent" ref="ff23c3efdd657d856c9d12b0ef8e746b" args="(cond)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define rAssertSilent          </td>
          <td>(</td>
          <td class="paramtype">cond&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keywordflow">do</span> { \
        <span class="keywordflow">if</span>( unlikely((cond) == <span class="keyword">false</span>) ) \
        { _rAssertFailed(RLOG_COMPONENT, STR(cond)); } \
    } <span class="keywordflow">while</span>(0)
</pre></div>Assert condition - throws error if <em>cond</em> evaluates to false, but does not display error message. 
<p>
Assert error condition. Similar to rAssert except that it does not display an error. 
</div>
</div><p>
<a class="anchor" name="f6851d4a9957532f491d58e8719ec281"></a><!-- doxytag: member="rlog.h::RLOG_NO_COPY" ref="f6851d4a9957532f491d58e8719ec281" args="(CNAME)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RLOG_NO_COPY          </td>
          <td>(</td>
          <td class="paramtype">CNAME&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keyword">private</span>: \
        CNAME(<span class="keyword">const</span> CNAME&amp;); \
        CNAME &amp; operator = (<span class="keyword">const</span> CNAME &amp;)
</pre></div>
</div>
</div><p>
<hr size="1"><address style="align: right;"><small>Generated on Mon Nov 20 22:57:44 2006 for rlog by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.0 </small></address>
</body>
</html>