📄 classlog4cpp_1_1fileappender.html
字号:
<!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>log4cpp: log4cpp::FileAppender Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.2 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div><div class="nav"><a class="el" href="namespacelog4cpp.html">log4cpp</a>::<a class="el" href="classlog4cpp_1_1FileAppender.html">FileAppender</a></div><h1>log4cpp::FileAppender Class Reference</h1><code>#include <<a class="el" href="FileAppender_8hh-source.html">FileAppender.hh</a>></code><p>Inheritance diagram for log4cpp::FileAppender:<p><center><img src="classlog4cpp_1_1FileAppender__inherit__graph.png" border="0" usemap="#log4cpp_1_1FileAppender__inherit__map" alt="Inheritance graph"></center><map name="log4cpp_1_1FileAppender__inherit__map"><area href="classlog4cpp_1_1RollingFileAppender.html" shape="rect" coords="8,307,202,331" alt=""><area href="classlog4cpp_1_1LayoutAppender.html" shape="rect" coords="18,158,192,182" alt=""><area href="classlog4cpp_1_1AppenderSkeleton.html" shape="rect" coords="13,83,197,107" alt=""><area href="classlog4cpp_1_1Appender.html" shape="rect" coords="38,9,172,33" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for log4cpp::FileAppender:<p><center><img src="classlog4cpp_1_1FileAppender__coll__graph.png" border="0" usemap="#log4cpp_1_1FileAppender__coll__map" alt="Collaboration graph"></center><map name="log4cpp_1_1FileAppender__coll__map"><area href="classlog4cpp_1_1LayoutAppender.html" shape="rect" coords="148,190,321,214" alt=""><area href="classlog4cpp_1_1AppenderSkeleton.html" shape="rect" coords="13,99,197,123" alt=""><area href="classlog4cpp_1_1Appender.html" shape="rect" coords="8,9,141,33" alt=""><area href="classlog4cpp_1_1Filter.html" shape="rect" coords="165,9,269,33" alt=""><area href="classlog4cpp_1_1Layout.html" shape="rect" coords="221,99,336,123" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classlog4cpp_1_1FileAppender-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#a0">FileAppender</a> (const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs a <a class="el" href="classlog4cpp_1_1FileAppender.html">FileAppender</a>. <a href="#a0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#a1">FileAppender</a> (const std::string &name, int fd)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs a <a class="el" href="classlog4cpp_1_1FileAppender.html">FileAppender</a> to an already open file descriptor. <a href="#a1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#a2">~FileAppender</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#a3">reopen</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Reopens the logfile. <a href="#a3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#a4">close</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Closes the logfile. <a href="#a4"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#a5">setAppend</a> (bool append)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the append vs truncate flag. <a href="#a5"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#a6">getAppend</a> () const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the value of the 'append' option. <a href="#a6"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#a7">setMode</a> (mode_t mode)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the file open mode. <a href="#a7"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual mode_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#a8">getMode</a> () const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the file open mode. <a href="#a8"></a><br></td></tr><tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#b0">_append</a> (const <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> &event)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Log in <a class="el" href="classlog4cpp_1_1Appender.html">Appender</a> specific way. <a href="#b0"></a><br></td></tr><tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">const std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#p0">_fileName</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#p1">_fd</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#p2">_flags</a></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">mode_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classlog4cpp_1_1FileAppender.html#p3">_mode</a></td></tr></table><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="a0" doxytag="log4cpp::FileAppender::FileAppender"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">log4cpp::FileAppender::FileAppender </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const std::string & </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const std::string & </td> <td class="mdname" nowrap> <em>fileName</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>append</em> = <code>true</code>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>mode_t </td> <td class="mdname" nowrap> <em>mode</em> = <code>00644</code></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Constructs a <a class="el" href="classlog4cpp_1_1FileAppender.html">FileAppender</a>. <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>name</em> </td><td>the name of the <a class="el" href="classlog4cpp_1_1Appender.html">Appender</a>. </td></tr> <tr><td valign="top"></td><td valign="top"><em>fileName</em> </td><td>the name of the file to which the <a class="el" href="classlog4cpp_1_1Appender.html">Appender</a> has to log. </td></tr> <tr><td valign="top"></td><td valign="top"><em>append</em> </td><td>whether the <a class="el" href="classlog4cpp_1_1Appender.html">Appender</a> has to truncate the file or just append to it if it already exists. Defaults to 'true'. </td></tr> <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>file mode to open the logfile with. Defaults to 00644. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a1" doxytag="log4cpp::FileAppender::FileAppender"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">log4cpp::FileAppender::FileAppender </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const std::string & </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>fd</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Constructs a <a class="el" href="classlog4cpp_1_1FileAppender.html">FileAppender</a> to an already open file descriptor. <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>name</em> </td><td>the name of the <a class="el" href="classlog4cpp_1_1Appender.html">Appender</a>. </td></tr> <tr><td valign="top"></td><td valign="top"><em>fd</em> </td><td>the file descriptor to which the <a class="el" href="classlog4cpp_1_1Appender.html">Appender</a> has to log. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a2" doxytag="log4cpp::FileAppender::~FileAppender"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">log4cpp::FileAppender::~FileAppender </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p> </td> </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="b0" doxytag="log4cpp::FileAppender::_append"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void log4cpp::FileAppender::_append </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> & </td> <td class="mdname1" valign="top" nowrap> <em>event</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [protected, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Log in <a class="el" href="classlog4cpp_1_1Appender.html">Appender</a> specific way. <p>Subclasses of <a class="el" href="classlog4cpp_1_1Appender.html">Appender</a> should implement this method to perform actual logging. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>event</em> </td><td>The <a class="el" href="structlog4cpp_1_1LoggingEvent.html">LoggingEvent</a> to log. </td></tr> </table></dl><p>Implements <a class="el" href="classlog4cpp_1_1AppenderSkeleton.html#b1">log4cpp::AppenderSkeleton</a>.<p>Reimplemented in <a class="el" href="classlog4cpp_1_1RollingFileAppender.html#b0">log4cpp::RollingFileAppender</a>. </td> </tr></table><a class="anchor" name="a4" doxytag="log4cpp::FileAppender::close"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void log4cpp::FileAppender::close </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -