⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 svcproc_8h-source.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<a name="l00130"></a><a class="code" href="classPSystemLog.html">00130</a> <span class="keyword">class </span><a class="code" href="classPSystemLog.html">PSystemLog</a> : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>, <span class="keyword">public</span> iostream {00131   <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPSystemLog.html">PSystemLog</a>, <a class="code" href="classPObject.html">PObject</a>);00132 00133   <span class="keyword">public</span>:00136 <a name="l00137"></a><a class="code" href="classPSystemLog.html#z401_0">00137</a>     <span class="keyword">enum</span> <a class="code" href="classPSystemLog.html#z401_0">Level</a> {00139       <a class="code" href="classPSystemLog.html#z401_0s0">StdError</a> = -1,00141       <a class="code" href="classPSystemLog.html#z401_0s1">Fatal</a>,   00143       <a class="code" href="classPSystemLog.html#z401_0s2">Error</a>,    00145       <a class="code" href="classPSystemLog.html#z401_0s3">Warning</a>,  00147       <a class="code" href="classPSystemLog.html#z401_0s4">Info</a>,     00149       <a class="code" href="classPSystemLog.html#z401_0s5">Debug</a>,    00151       <a class="code" href="classPSystemLog.html#z401_0s6">Debug2</a>,   00153       <a class="code" href="classPSystemLog.html#z401_0s7">Debug3</a>,   00155       <a class="code" href="classPSystemLog.html#z401_0s8">Debug4</a>,   00157       <a class="code" href="classPSystemLog.html#z401_0s9">Debug5</a>,   00159       <a class="code" href="classPSystemLog.html#z401_0s10">Debug6</a>,   00160 00161       <a class="code" href="classPSystemLog.html#z401_0s11">NumLogLevels</a>00162     };00163 <a name="l00165"></a><a class="code" href="classPSystemLog.html#z401_1">00165</a>     <a class="code" href="classPSystemLog.html#z401_1">PSystemLog</a>(00166      <a class="code" href="classPSystemLog.html#z401_0">Level</a> level   00167     ) : iostream(cout.rdbuf()) { logLevel = level; buffer.log = <span class="keyword">this</span>; init(&amp;buffer); }00168 <a name="l00170"></a><a class="code" href="classPSystemLog.html#z401_2">00170</a>     <a class="code" href="classPSystemLog.html#z401_2">~PSystemLog</a>() { flush(); }00172 00177     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classPSystemLog.html#z403_0">Output</a>(00178       <a class="code" href="classPSystemLog.html#z401_0">Level</a> level,      00179       <span class="keyword">const</span> <span class="keywordtype">char</span> * msg  00180     );00182 <a name="l00188"></a><a class="code" href="classPSystemLog.html#z405_0">00188</a>     <span class="keywordtype">void</span> <a class="code" href="classPSystemLog.html#z405_0">SetLevel</a>(00189       <a class="code" href="classPSystemLog.html#z401_0">Level</a> level  00190     ) { logLevel = level; }00191 <a name="l00197"></a><a class="code" href="classPSystemLog.html#z405_1">00197</a>     <a class="code" href="classPSystemLog.html#z401_0">Level</a> <a class="code" href="classPSystemLog.html#z405_1">GetLevel</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> logLevel; }00199 00200   <span class="keyword">private</span>:00201     <a class="code" href="classPSystemLog.html#z401_1">PSystemLog</a>(<span class="keyword">const</span> <a class="code" href="classPSystemLog.html">PSystemLog</a> &amp;) : iostream(cout.rdbuf()) { }00202     <a class="code" href="classPSystemLog.html">PSystemLog</a> &amp; operator=(<span class="keyword">const</span> <a class="code" href="classPSystemLog.html">PSystemLog</a> &amp;) { <span class="keywordflow">return</span> *<span class="keyword">this</span>; }00203 00204     <span class="keyword">class </span><a class="code" href="classPSystemLog.html#l0">Buffer</a> : <span class="keyword">public</span> streambuf {00205       <span class="keyword">public</span>:00206         <span class="keyword">virtual</span> <span class="keywordtype">int</span> overflow(<span class="keywordtype">int</span>=EOF);00207         <span class="keyword">virtual</span> <span class="keywordtype">int</span> underflow();00208         <span class="keyword">virtual</span> <span class="keywordtype">int</span> sync();00209         <a class="code" href="classPSystemLog.html">PSystemLog</a> * log;00210         <a class="code" href="classPString.html">PString</a> string;00211     } buffer;<a name="l00212"></a><a class="code" href="classPSystemLog.html#l0">00212</a>     <span class="keyword">friend</span> <span class="keyword">class </span>Buffer;00213 00214     <a class="code" href="classPSystemLog.html#z401_0">Level</a> logLevel;00215 };00216 00217 <a name="l00222"></a><a class="code" href="svcproc_8h.html#a0">00222</a> <span class="preprocessor">#define PSYSTEMLOG(level, variables) \</span>00223 <span class="preprocessor">  if (PServiceProcess::Current().GetLogLevel() &gt;= PSystemLog::level) { \</span>00224 <span class="preprocessor">    PSystemLog P_systemlog(PSystemLog::level); \</span>00225 <span class="preprocessor">    P_systemlog &lt;&lt; variables; \</span>00226 <span class="preprocessor">  } else (void)0</span>00227 <span class="preprocessor"></span>00228 00229 <a name="l00233"></a><a class="code" href="classPServiceProcess.html">00233</a> <span class="keyword">class </span><a class="code" href="classPServiceProcess.html">PServiceProcess</a> : <span class="keyword">public</span> <a class="code" href="classPProcess.html">PProcess</a>00234 {00235   <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPServiceProcess.html">PServiceProcess</a>, <a class="code" href="classPProcess.html">PProcess</a>);00236 00237   <span class="keyword">public</span>:00242     <a class="code" href="classPServiceProcess.html#z407_0">PServiceProcess</a>(00243       <span class="keyword">const</span> <span class="keywordtype">char</span> * manuf,   00244       <span class="keyword">const</span> <span class="keywordtype">char</span> * name,    00245       WORD majorVersion,    00246       WORD minorVersion,    00247       <a class="code" href="classPProcess.html#z221_0">CodeStatus</a> status,    00248       WORD buildNumber      00249     );00251 00261     <span class="keyword">virtual</span> BOOL <a class="code" href="classPServiceProcess.html#z409_0">OnStart</a>() = 0;00262 00267     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPServiceProcess.html#z409_1">OnStop</a>();00268 00277     <span class="keyword">virtual</span> BOOL <a class="code" href="classPServiceProcess.html#z409_2">OnPause</a>();00278 00281     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPServiceProcess.html#z409_3">OnContinue</a>();00282 00285     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPServiceProcess.html#z409_4">OnControl</a>() = 0;00287 00295     <span class="keyword">static</span> <a class="code" href="classPServiceProcess.html">PServiceProcess</a> &amp; <a class="code" href="classPServiceProcess.html#z411_2">Current</a>();00296 00297 <a name="l00307"></a><a class="code" href="classPServiceProcess.html#z411_0">00307</a>     <span class="keywordtype">void</span> <a class="code" href="classPServiceProcess.html#z411_0">SetLogLevel</a>(00308       <a class="code" href="classPSystemLog.html#z401_0">PSystemLog::Level</a> level  00309     ) { <a class="code" href="classPServiceProcess.html#n1">currentLogLevel</a> = level; }00310 <a name="l00316"></a><a class="code" href="classPServiceProcess.html#z411_1">00316</a>     <a class="code" href="classPSystemLog.html#z401_0">PSystemLog::Level</a> <a class="code" href="classPServiceProcess.html#z411_1">GetLogLevel</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPServiceProcess.html#n1">currentLogLevel</a>; }00318 00319 00320     <span class="comment">/* Internal initialisation function called directly from</span>00321 <span class="comment">       #main()#. The user should never call this function.</span>00322 <span class="comment">     */</span>00323     <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classPServiceProcess.html#a0">_main</a>(<span class="keywordtype">void</span> * arg = NULL);00324 00325 00326   <span class="keyword">protected</span>:00327   <span class="comment">// Member variables</span><a name="l00329"></a><a class="code" href="classPServiceProcess.html#n0">00329</a> <span class="comment">    BOOL debugMode;</span>00330 <a name="l00332"></a><a class="code" href="classPServiceProcess.html#n1">00332</a>     <a class="code" href="classPSystemLog.html#z401_0">PSystemLog::Level</a> <a class="code" href="classPServiceProcess.html#n1">currentLogLevel</a>;00333 00334     <span class="keyword">friend</span> <span class="keywordtype">void</span> <a class="code" href="classPSystemLog.html#z403_0">PSystemLog::Output</a>(<a class="code" href="classPSystemLog.html#z401_0">PSystemLog::Level</a>, <span class="keyword">const</span> <span class="keywordtype">char</span> *);00335 00336 00337 <span class="comment">// Include platform dependent part of class</span>00338 <span class="preprocessor">#ifdef _WIN32</span>00339 <span class="preprocessor"></span><span class="preprocessor">#include "msos/ptlib/svcproc.h"</span>00340 <span class="preprocessor">#else</span>00341 <span class="preprocessor"></span><span class="preprocessor">#include "unix/ptlib/svcproc.h"</span>00342 <span class="preprocessor">#endif</span>00343 <span class="preprocessor"></span>};00344 00345 <span class="preprocessor">#endif</span>00346 <span class="preprocessor"></span>00347 00348 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:12 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -