📄 classlogger.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Logger class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </center>
<hr><h1>Logger Class Reference</h1><code>#include <<a class="el" href="logger_8h-source.html">logger.h</a>></code>
<p>
<p>Inheritance diagram for Logger:
<p><center><img src="classLogger.png" usemap="#Logger_map" border="0"></center>
<map name="Logger_map">
<area href="classSMTP.html" alt="SMTP" shape="rect" coords="0,56,74,80">
<area href="classSocket.html" alt="Socket" shape="rect" coords="84,56,158,80">
<area href="classSSLSocket.html" alt="SSLSocket" shape="rect" coords="84,112,158,136">
<area href="classInetSocket.html" alt="InetSocket" shape="rect" coords="42,168,116,192">
<area href="classUnixSocket.html" alt="UnixSocket" shape="rect" coords="126,168,200,192">
</map>
<a href="classLogger-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td nowrap align=right valign=top>enum </td><td valign=bottom><a class="el" href="classLogger.html#s5">VERBOSITY</a> { <br>
<b>QUIET</b> = 0,
<b>ERROR</b> = 1,
<b>NORMAL</b> = 2,
<b>VERBOSE</b> = 3,
<br>
<b>VVERBOSE</b> = 4
<br>
}</td></tr>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classLogger.html#a0">Logger</a> ()</td></tr>
<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classLogger.html#a1">Logger</a> (streambuf *sbuf)</td></tr>
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classLogger.html#a2">setVerbosity</a> (<a class="el" href="classLogger.html#s5">VERBOSITY</a> <a class="el" href="classLogger.html#n2">verbosity</a>)</td></tr>
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classLogger.html#a3">setCallBackFunction</a> (funcPtr <a class="el" href="classLogger.html#n1">callback_function</a>)</td></tr>
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classLogger.html#a4">setCallBackObject</a> (<a class="el" href="classLoggerInterface.html">LoggerInterface</a> *<a class="el" href="classLogger.html#n0">callback_object</a>)</td></tr>
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classLogger.html#a5">setParentLogger</a> (Logger *<a class="el" href="classLogger.html#n4">parent</a>)</td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="classLogger.html#s5">VERBOSITY</a> </td><td valign=bottom><a class="el" href="classLogger.html#a6">getVerbosity</a> ()</td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="classLoggerInterface.html">LoggerInterface</a> * </td><td valign=bottom><a class="el" href="classLogger.html#a7">getCallBackObject</a> ()</td></tr>
<tr><td nowrap align=right valign=top>funcPtr </td><td valign=bottom><a class="el" href="classLogger.html#a8">getCallBackFunction</a> ()</td></tr>
<tr><td nowrap align=right valign=top>Logger & </td><td valign=bottom><a class="el" href="classLogger.html#a9">operator<<</a> (<a class="el" href="classLogger.html#s5">VERBOSITY</a> <a class="el" href="classLogger.html#n2">verbosity</a>)</td></tr>
<tr><td nowrap align=right valign=top><a name="a10" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (bool val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a11" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (short val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a12" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (unsigned short val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a13" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (int val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a14" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (unsigned int val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a15" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (long val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a16" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (unsigned long val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a17" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (float val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a18" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (double val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a19" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (long double val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a20" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (const void *val)</td></tr>
<tr><td nowrap align=right valign=top><a name="a21" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (char ch)</td></tr>
<tr><td nowrap align=right valign=top><a name="a22" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (signed char ch)</td></tr>
<tr><td nowrap align=right valign=top><a name="a23" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (unsigned char ch)</td></tr>
<tr><td nowrap align=right valign=top><a name="a24" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (const char *str)</td></tr>
<tr><td nowrap align=right valign=top><a name="a25" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (const signed char *str)</td></tr>
<tr><td nowrap align=right valign=top><a name="a26" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (const unsigned char *str)</td></tr>
<tr><td nowrap align=right valign=top><a name="a27" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (streambuf *sb)</td></tr>
<tr><td nowrap align=right valign=top><a name="a28" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (__omanip func)</td></tr>
<tr><td nowrap align=right valign=top><a name="a29" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (__manip func)</td></tr>
<tr><td nowrap align=right valign=top><a name="a30" doxytag="Logger::operator<<"></a>
Logger & </td><td valign=bottom><b>operator<<</b> (string str)</td></tr>
<tr><td colspan=2><br><h2>Protected Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classLogger.html#b0">sync</a> ()</td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="classLoggerInterface.html">LoggerInterface</a> * </td><td valign=bottom><a class="el" href="classLogger.html#n0">callback_object</a></td></tr>
<tr><td nowrap align=right valign=top>funcPtr </td><td valign=bottom><a class="el" href="classLogger.html#n1">callback_function</a></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="classLogger.html#s5">VERBOSITY</a> </td><td valign=bottom><a class="el" href="classLogger.html#n2">verbosity</a></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="classLogger.html#s5">VERBOSITY</a> </td><td valign=bottom><a class="el" href="classLogger.html#n3">lvl</a></td></tr>
<tr><td nowrap align=right valign=top>Logger * </td><td valign=bottom><a class="el" href="classLogger.html#n4">parent</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A Stream that can be used to control log messages. The log messages are either dumped to stdout, resp. the streambuf object given to the constructor but can also be intercepted by specifying a callback method, resp. object. This class should be inheritated and the macros defined above should be used log log messages.
<p>
<hr><h2>Member Enumeration Documentation</h2>
<a name="s5" doxytag="Logger::VERBOSITY"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum Logger::VERBOSITY
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
The log levels. </td>
</tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a name="a0" doxytag="Logger::Logger"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> Logger::Logger </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructor. </td>
</tr>
</table>
<a name="a1" doxytag="Logger::Logger"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> Logger::Logger </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">streambuf * </td>
<td class="mdname1" valign="top" nowrap> <em>sbuf</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructor.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>sbuf</em> </td><td>
The streambuf object that should be used for output. </td></tr>
</table>
</dl> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a8" doxytag="Logger::getCallBackFunction"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> funcPtr Logger::getCallBackFunction </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the callback function.
<p>
<dl compact><dt><b>
Returns: </b><dd>
The callback_function. </dl> </td>
</tr>
</table>
<a name="a7" doxytag="Logger::getCallBackObject"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classLoggerInterface.html">LoggerInterface</a> * Logger::getCallBackObject </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the callback object.
<p>
<dl compact><dt><b>
Returns: </b><dd>
The callback_object. </dl> </td>
</tr>
</table>
<a name="a6" doxytag="Logger::getVerbosity"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classLogger.html#s5">Logger::VERBOSITY</a> Logger::getVerbosity </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the verbosity level.
<p>
<dl compact><dt><b>
Returns: </b><dd>
The verbosity level. </dl> </td>
</tr>
</table>
<a name="a9" doxytag="Logger::operator<<"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> Logger & Logger::operator<< </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classLogger.html#s5">VERBOSITY</a> </td>
<td class="mdname1" valign="top" nowrap> <em>verbosity</em> </td>
<td class="md" valign="top">) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -