Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > f448deafa1de20c56618e7ac9c6ef5d7 > files > 101

Falcon-doc-0.9.6.6-1.fc14.noarch.rpm

<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Class LogChannel - Class LogChannel</title>
   <link href="faldoc.css" rel="stylesheet" type="text/css"/>
   <link href="tabs.css" rel="stylesheet" type="text/css"/>
</head>
<body class="faldoc_body">
<div class="navitop">
   <div class="tabs">
      <ul>
         <li><a href="./index.html"><span>Main</span></a></li>
         <li><a href="./modules.html"><span>Modules</span></a></li>
         <li><a href="./pages.html"><span>Related pages</span></a></li>
         <li><a href="./groups.html"><span>Groups</span></a></li>
         <li><a href="./classes.html"><span>Classes</span></a></li>
         <li><a href="./objects.html"><span>Objects</span></a></li>
         <li><a href="./functions.html"><span>All functions</span></a></li>
         <li><a href="./enum.html"><span>Enumerations</span></a></li>
         
      </ul>
   </div>
</div>
<hr/>

<h1 class="faldoc_title">Class LogChannel<span class="faldoc_belong"><a href="./module_feather_logging.html">[in Logging support]</a></p></h1>

<p class="faldoc_brief">Abstract class receiving log requests from log areas. </p>
<p class="faldoc_funcdecl">
<b>class</b> LogChannel
</p>


   <p class="faldoc_brief"><a href="#more">more...</a></p>
   <h2 class="faldoc_title">Summary</h2>
   <table class="faldoc_list">
   
      
         <tr><td><a href="#format">format()</a></td><td>Gets or set the log message formatting setting. </td></tr>
      
         <tr><td><a href="#level">level()</a></td><td>Gets or set the log level. </td></tr>
      
   
   </table>







<a name="more"><h2 class="faldoc_title">Detailed description</h2></a>

<p class="faldoc_funcdecl">
<b>class</b> LogChannel
</p>
<table class="faldoc_function">


</table>
<br/>
<p class="item_brief">Abstract class receiving log requests from log areas. </p>
<p class="faldoc_text">This class cannot directly instantiated. Calling it directlty will generate a code error. </p>




   <h2 class="faldoc_title">Methods</h2>
   
      <h3 class="faldoc_funcname"><a name="format">format()</a></h3>
      <p class="item_brief">Gets or set the log message formatting setting. </p>
      <p class="faldoc_funcdecl">LogChannel.format( [format] )</p>
      
         <table class="faldoc_function">
         
         <tr><td class="faldoc_optparam">format</td><td class="faldoc_optparamdesc">the new format to set (a string). </td></tr>
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">The current log message format (a string). </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text"> The message <b>format</b> is a template string filled with informations from the logging system. Some loggin subsystems (as the MS-Windows Event Logger, or as the Posix SYSLOG system) fill autonomously informations on behalf of the application, while others (file and stream based loggers) require a format to print meaningful informations as the timestamp. </p>
<p class="faldoc_text">The format string can contain the following escape codes: </p>
<ul>
<li>%a: Application area requesting the log (name of the LogArea). </li><li>%c: Numeric code as passed in the "code" optional parameter. </li><li>%C: Numeric code as passed in the "code" optional parameter, zero padded to 5 digits. </li><li>%d: date in YYYY-MM-DD format. </li><li>%f: Function calling the log request. </li><li>%l: Log level as a numeric integer. </li><li>%L: Letter representing the log level (one character). </li><li>%M: Name of the module requesting the log. </li><li>%m: Log message. </li><li>%R: date in RFC2822 format (as "Sun, 06 Sep 2009 18:16:20 +0200") </li><li>%s: Milliseconds since the start of the program in seconds and fractions. </li><li>%S: Milliseconds since the start of the program (absolute). </li><li>%t: timestamp in HH:MM:SS.mmm format. </li><li>%T: timestamp in YYYY-MM-DD HH:MM:SS.mmm format. </li><li>%%: The "%" character. </li>
</ul>
<p class="faldoc_text">For example, the pattern "%t\t%L (%M)\t%m" will print something like </p>
<pre class="faldoc_code">
   13:22:18.344   D (testbind)   Debug message from testbind.
</pre>
<p class="faldoc_text">The module also provides some standard log format code that can be useful in the most common situations as constants defined at toplevel. They are the following: </p>
<ul>
<li><b>LOGFMT_TRACE</b>: "[%s %M.%f]\t%m" -- this is useful for logs meant to trace application progress and perform debug sessions. It indicates how many seconds and fractions have passed and the function calling sending the log message. </li><li><b>LOGFMT_ERROR</b>: "%T\t%L%C\t[%a]\t%m" --  this format indicates the complete date and time at which an error took place, the error level and code (padded to 5 digits), the area that generated this error and the message. </li><li><b>LOGFMT_ERRORP</b>: "%T\t%L%C\t[%a:%M.%f]\t%m" -- This format is the same as LOGFMT_ERROR, but it adds the name of the module and function that generated the log to the area description. </li><li><b>LOGFMT_ERRORT</b>: "%T\t%L%C\t[%M.%f]\t%m" -- This format is the same as LOGFMT_ERRORP, but it doesn't report the log area generating the log. Useful if you know that you will be using the general area only. </li><li><b>LOGFMT_ENTRY</b>: "%T\t(%L) %m" -- Simpler format, reporting the day and time in which a log entry is generated, the log level and the message. </li><li><b>LOGFMT_ENTRYP</b>: "%T\t(%L)  [%a]%m" -- Like LOGFMT_ENTRY, but reporting also the log area. </li>
</ul>
</p>
   
      <h3 class="faldoc_funcname"><a name="level">level()</a></h3>
      <p class="item_brief">Gets or set the log level. </p>
      <p class="faldoc_funcdecl">LogChannel.level( [level] )</p>
      
         <table class="faldoc_function">
         
         <tr><td class="faldoc_optparam">level</td><td class="faldoc_optparamdesc">a new log level to be set. </td></tr>
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">The current log level. </td></tr>
         
         </table>
      
      
   

<hr/>
<div class="navibottom">
   <center>
      <a href="./index.html">Main</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./modules.html">Modules</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./pages.html">Related pages</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./groups.html">Groups</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./classes.html">Classes</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./objects.html">Objects</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./functions.html">All functions</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./enum.html">Enumerations</a>
   </center>
</div>
</div>
<div class="faldoc_signature">Made with <a href="http://www.falconpl.org">faldoc 2.2.0</div>
</body>
</html>