<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>ITK: itkLoggerBase.h Source File</title> <link href="DoxygenStyle.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Section customized for INSIGHT : Tue Jul 17 01:02:45 2001 --> <center> <a href="index.html" class="qindex">Main Page</a> <a href="modules.html" class="qindex">Groups</a> <a href="namespaces.html" class="qindex">Namespace List</a> <a href="hierarchy.html" class="qindex">Class Hierarchy</a> <a href="classes.html" class="qindex">Alphabetical List</a> <a href="annotated.html" class="qindex">Compound List</a> <a href="files.html" class="qindex">File List</a> <a href="namespacemembers.html" class="qindex">Namespace Members</a> <a href="functions.html" class="qindex">Compound Members</a> <a href="globals.html" class="qindex">File Members</a> <a href="pages.html" class="qindex">Concepts</a></center> <!-- Generated by Doxygen 1.5.9 --> <div class="navpath"><a class="el" href="dir_02e23d841c198393a6e961e9a0678fff.html">Code</a> » <a class="el" href="dir_ea7fc529ede9a38b0438cf13831ae873.html">Common</a> </div> <div class="contents"> <h1>itkLoggerBase.h</h1><a href="itkLoggerBase_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> Program: Insight Segmentation & Registration Toolkit</span> <a name="l00004"></a>00004 <span class="comment"> Module: $RCSfile: itkLoggerBase.h,v $</span> <a name="l00005"></a>00005 <span class="comment"> Language: C++</span> <a name="l00006"></a>00006 <span class="comment"> Date: $Date: 2007-05-21 09:08:55 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.7 $</span> <a name="l00008"></a>00008 <span class="comment"></span> <a name="l00009"></a>00009 <span class="comment"> Copyright (c) Insight Software Consortium. All rights reserved.</span> <a name="l00010"></a>00010 <span class="comment"> See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.</span> <a name="l00011"></a>00011 <span class="comment"></span> <a name="l00012"></a>00012 <span class="comment"> This software is distributed WITHOUT ANY WARRANTY; without even</span> <a name="l00013"></a>00013 <span class="comment"> the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR</span> <a name="l00014"></a>00014 <span class="comment"> PURPOSE. See the above copyright notices for more information.</span> <a name="l00015"></a>00015 <span class="comment"></span> <a name="l00016"></a>00016 <span class="comment">=========================================================================*/</span> <a name="l00017"></a>00017 <a name="l00018"></a>00018 <span class="preprocessor">#ifndef __itkLoggerBase_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define __itkLoggerBase_h</span> <a name="l00020"></a>00020 <span class="preprocessor"></span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="itkObject_8h.html">itkObject.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="itkObjectFactory_8h.html">itkObjectFactory.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="itkMultipleLogOutput_8h.html">itkMultipleLogOutput.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="itkRealTimeClock_8h.html">itkRealTimeClock.h</a>"</span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="keyword">namespace </span>itk <a name="l00027"></a>00027 { <a name="l00038"></a><a class="code" href="classitk_1_1LoggerBase.html">00038</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#faefe352c9fb4179f5a770afc70ea90f">ITKCommon_EXPORT</a> <a class="code" href="classitk_1_1LoggerBase.html" title="Class LoggerBase is meant for logging information during a run.">LoggerBase</a> : <span class="keyword">public</span> <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a> <a name="l00039"></a>00039 { <a name="l00040"></a>00040 <a name="l00041"></a>00041 <span class="keyword">public</span>: <a name="l00042"></a>00042 <a name="l00043"></a><a class="code" href="classitk_1_1LoggerBase.html#a8860e3e4c064b5bd9f8de65ca68e211">00043</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1LoggerBase.html" title="Class LoggerBase is meant for logging information during a run.">LoggerBase</a> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>; <a name="l00044"></a><a class="code" href="classitk_1_1LoggerBase.html#276a449248d4ebfa9e86bd21a32d1ed6">00044</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a> <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Superclass</a>; <a name="l00045"></a><a class="code" href="classitk_1_1LoggerBase.html#eec61819a8df12d93fa58a3fc5496852">00045</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer<Self></a> <a class="code" href="classitk_1_1SmartPointer.html">Pointer</a>; <a name="l00046"></a><a class="code" href="classitk_1_1LoggerBase.html#cf7bf0aa95eeadb9cf10f4bb70624c6c">00046</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer<const Self></a> <a class="code" href="classitk_1_1SmartPointer.html">ConstPointer</a>; <a name="l00047"></a>00047 <a name="l00049"></a><a class="code" href="classitk_1_1LoggerBase.html#08bfd6c6ee3707136044dbfeaf6c76cb">00049</a> <a class="code" href="itkMacro_8h.html#574c1f86661d409dd32c742307a0e96a">itkTypeMacro</a>( <a class="code" href="classitk_1_1LoggerBase.html" title="Class LoggerBase is meant for logging information during a run.">LoggerBase</a>, <a class="code" href="classitk_1_1Object.html" title="Base class for most itk classes.">Object</a> ); <a name="l00050"></a>00050 <a name="l00051"></a>00051 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1LogOutput.html" title="Class LogOutput represents an output stream.">MultipleLogOutput::OutputType</a> <a class="code" href="classitk_1_1LogOutput.html" title="Class LogOutput represents an output stream.">OutputType</a>; <a name="l00052"></a>00052 <a name="l00055"></a><a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5">00055</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00056"></a>00056 { <a name="l00057"></a><a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5b894a271324a795b4e109b8c8a17c9bb">00057</a> MUSTFLUSH=0, <a name="l00058"></a><a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5e16760f45479d80af6272939d9dd9145">00058</a> FATAL, <a name="l00059"></a><a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5b709a47067b8512afb19425cb3839be2">00059</a> CRITICAL, <a name="l00060"></a><a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5cc9286b2df7dcce11b2f0b5da4972705">00060</a> WARNING, <a name="l00061"></a><a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec502bdf15b5ef3c48e41c129d11807d5a6">00061</a> INFO, <a name="l00062"></a><a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5da9ce09b9d6088907f70eb22a793876f">00062</a> DEBUG, <a name="l00063"></a><a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec563b705c8e84f644893fd5798983ac809">00063</a> NOTSET <a name="l00064"></a>00064 } PriorityLevelType; <a name="l00065"></a>00065 <a name="l00066"></a>00066 <a class="code" href="itkMacro_8h.html#3b9c68842cd296d3ef6d1ed0f5a742a4">itkSetStringMacro</a>(Name); <a name="l00067"></a>00067 <a class="code" href="itkMacro_8h.html#bea8d1eeb8af8f01bfec0169f63f6871">itkGetStringMacro</a>(Name); <a name="l00068"></a>00068 <a name="l00070"></a><a class="code" href="classitk_1_1LoggerBase.html#cedec6acd353e2e7b7f83964557588e6">00070</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00071"></a>00071 { <a name="l00072"></a><a class="code" href="classitk_1_1LoggerBase.html#cedec6acd353e2e7b7f83964557588e6d25933688796c8665f63920b0d90b645">00072</a> REALVALUE=0, <a name="l00073"></a><a class="code" href="classitk_1_1LoggerBase.html#cedec6acd353e2e7b7f83964557588e6b3196a073faa948070caf0d729a44041">00073</a> HUMANREADABLE <a name="l00074"></a>00074 } TimeStampFormatType; <a name="l00075"></a>00075 <a name="l00085"></a>00085 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>( TimeStampFormat, TimeStampFormatType ); <a name="l00086"></a>00086 <a class="code" href="itkMacro_8h.html#7d989c13a1a213168db99ae0f84185d4">itkGetConstReferenceMacro</a>( TimeStampFormat, TimeStampFormatType ); <a name="l00088"></a>00088 <a name="l00097"></a>00097 <a class="code" href="itkMacro_8h.html#3b9c68842cd296d3ef6d1ed0f5a742a4">itkSetStringMacro</a>( HumanReadableFormat ); <a name="l00098"></a>00098 <a class="code" href="itkMacro_8h.html#bea8d1eeb8af8f01bfec0169f63f6871">itkGetStringMacro</a>( HumanReadableFormat ); <a name="l00100"></a>00100 <a name="l00102"></a>00102 <span class="keyword">virtual</span> std::string BuildFormattedEntry(PriorityLevelType level, <a name="l00103"></a>00103 std::string <span class="keyword">const</span> & content); <a name="l00104"></a>00104 <a name="l00108"></a><a class="code" href="classitk_1_1LoggerBase.html#8ee9d8bfa0c3a9329b33b77617c541fc">00108</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetPriorityLevel( <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5">PriorityLevelType</a> level ) <a name="l00109"></a>00109 { <a name="l00110"></a>00110 m_PriorityLevel = level; <a name="l00111"></a>00111 } <a name="l00112"></a>00112 <a name="l00116"></a><a class="code" href="classitk_1_1LoggerBase.html#8e3f3eb263faf623747aa7d65553658c">00116</a> <span class="keyword">virtual</span> <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5">PriorityLevelType</a> GetPriorityLevel()<span class="keyword"> const</span> <a name="l00117"></a>00117 <span class="keyword"> </span>{ <a name="l00118"></a>00118 <span class="keywordflow">return</span> m_PriorityLevel; <a name="l00119"></a>00119 } <a name="l00120"></a>00120 <a name="l00121"></a><a class="code" href="classitk_1_1LoggerBase.html#8d2f0a6c11af21a6e5b330a158a577be">00121</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetLevelForFlushing( <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5">PriorityLevelType</a> level ) <a name="l00122"></a>00122 { <a name="l00123"></a>00123 m_LevelForFlushing = level; <a name="l00124"></a>00124 } <a name="l00125"></a>00125 <a name="l00126"></a><a class="code" href="classitk_1_1LoggerBase.html#8fb89663aa178278470f36e0ab3a1595">00126</a> <span class="keyword">virtual</span> <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5">PriorityLevelType</a> GetLevelForFlushing()<span class="keyword"> const</span> <a name="l00127"></a>00127 <span class="keyword"> </span>{ <a name="l00128"></a>00128 <span class="keywordflow">return</span> m_LevelForFlushing; <a name="l00129"></a>00129 } <a name="l00130"></a>00130 <a name="l00132"></a>00132 <span class="keyword">virtual</span> <span class="keywordtype">void</span> AddLogOutput( OutputType* output ); <a name="l00133"></a>00133 <a name="l00134"></a>00134 <a name="l00135"></a>00135 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Write(PriorityLevelType level, std::string <span class="keyword">const</span> & content); <a name="l00137"></a><a class="code" href="classitk_1_1LoggerBase.html#e3a4e13b175508d42aac5b4dbe142881">00137</a> <span class="keywordtype">void</span> Debug ( std::string <span class="keyword">const</span>& message ) <a name="l00138"></a>00138 { <a name="l00139"></a>00139 this->Write ( <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5da9ce09b9d6088907f70eb22a793876f">LoggerBase::DEBUG</a>, message ); <a name="l00140"></a>00140 } <a name="l00141"></a><a class="code" href="classitk_1_1LoggerBase.html#ecfb13972a6692c72cca6cf043e328b4">00141</a> <span class="keywordtype">void</span> Info ( std::string <span class="keyword">const</span>& message ) <a name="l00142"></a>00142 { <a name="l00143"></a>00143 this->Write ( <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec502bdf15b5ef3c48e41c129d11807d5a6">LoggerBase::INFO</a>, message ); <a name="l00144"></a>00144 } <a name="l00145"></a><a class="code" href="classitk_1_1LoggerBase.html#931ccd481249d5c86654bbc0ad924fa2">00145</a> <span class="keywordtype">void</span> Warning ( std::string <span class="keyword">const</span>& message ) <a name="l00146"></a>00146 { <a name="l00147"></a>00147 this->Write ( <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5cc9286b2df7dcce11b2f0b5da4972705">LoggerBase::WARNING</a>, message ); <a name="l00148"></a>00148 } <a name="l00149"></a><a class="code" href="classitk_1_1LoggerBase.html#fa0fa963513d2ab30ad73bc92f68e67e">00149</a> <span class="keywordtype">void</span> Critical ( std::string <span class="keyword">const</span>& message ) <a name="l00150"></a>00150 { <a name="l00151"></a>00151 this->Write ( <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5b709a47067b8512afb19425cb3839be2">LoggerBase::CRITICAL</a>, message ); <a name="l00152"></a>00152 } <a name="l00153"></a><a class="code" href="classitk_1_1LoggerBase.html#795bdefba59ff5937932fd8426456053">00153</a> <span class="keywordtype">void</span> Error ( std::string <span class="keyword">const</span>& message ) <a name="l00154"></a>00154 { <a name="l00155"></a>00155 this->Write ( <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5b709a47067b8512afb19425cb3839be2">LoggerBase::CRITICAL</a>, message ); <a name="l00156"></a>00156 } <a name="l00157"></a><a class="code" href="classitk_1_1LoggerBase.html#b91f27a3a07cb5c57844efe44367808c">00157</a> <span class="keywordtype">void</span> Fatal ( std::string <span class="keyword">const</span>& message ) <a name="l00158"></a>00158 { <a name="l00159"></a>00159 this->Write ( <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5e16760f45479d80af6272939d9dd9145">LoggerBase::FATAL</a>, message ); <a name="l00160"></a>00160 } <a name="l00162"></a>00162 <a name="l00163"></a>00163 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Flush(); <a name="l00164"></a>00164 <a name="l00165"></a>00165 <span class="keyword">protected</span>: <a name="l00166"></a>00166 <a name="l00168"></a>00168 <a class="code" href="classitk_1_1LoggerBase.html" title="Class LoggerBase is meant for logging information during a run.">LoggerBase</a>(); <a name="l00169"></a>00169 <a name="l00171"></a>00171 <span class="keyword">virtual</span> ~<a class="code" href="classitk_1_1LoggerBase.html" title="Class LoggerBase is meant for logging information during a run.">LoggerBase</a>(); <a name="l00172"></a>00172 <a name="l00174"></a>00174 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#920ae03048a5ad715d803ca2e92b52de">PrintSelf</a>(std::ostream &os, <a class="code" href="classitk_1_1Indent.html" title="Control indentation during Print() invocation.">Indent</a> indent) <span class="keyword">const</span>; <a name="l00175"></a>00175 <a name="l00176"></a>00176 <span class="keyword">protected</span>: <a name="l00177"></a>00177 <a name="l00178"></a><a class="code" href="classitk_1_1LoggerBase.html#2d80a7a8f0853f14369c5d8fb4f7d305">00178</a> <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5">PriorityLevelType</a> m_PriorityLevel; <a name="l00179"></a>00179 <a name="l00180"></a><a class="code" href="classitk_1_1LoggerBase.html#947232f2359d1cfe93df5d6b3e28a2ab">00180</a> <a class="code" href="classitk_1_1LoggerBase.html#151ceda0a9987ee12137b5a9e0db5ec5">PriorityLevelType</a> m_LevelForFlushing; <a name="l00181"></a>00181 <a name="l00182"></a><a class="code" href="classitk_1_1LoggerBase.html#35aabbe0c3cac680b87f584cd1d3c0cc">00182</a> <a class="code" href="classitk_1_1SmartPointer.html">MultipleLogOutput::Pointer</a> m_Output; <a name="l00183"></a>00183 <a name="l00184"></a><a class="code" href="classitk_1_1LoggerBase.html#4400dee0921e8ec5387e770ef1dc9226">00184</a> <a class="code" href="classitk_1_1SmartPointer.html">RealTimeClock::Pointer</a> m_Clock; <a name="l00185"></a>00185 <a name="l00186"></a><a class="code" href="classitk_1_1LoggerBase.html#b033a9400d3c7869f57793fa18f174cf">00186</a> <a class="code" href="classitk_1_1LoggerBase.html#cedec6acd353e2e7b7f83964557588e6">TimeStampFormatType</a> m_TimeStampFormat; <a name="l00187"></a>00187 <a name="l00188"></a><a class="code" href="classitk_1_1LoggerBase.html#a9aa69e7a8310f453533daf987972139">00188</a> std::string m_HumanReadableFormat; <a name="l00189"></a>00189 <a name="l00190"></a>00190 <span class="keyword">private</span>: <a name="l00191"></a>00191 <a name="l00192"></a>00192 std::string m_Name; <a name="l00193"></a>00193 <a name="l00194"></a>00194 }; <span class="comment">// class LoggerBase</span> <a name="l00195"></a>00195 <a name="l00196"></a>00196 } <span class="comment">// namespace itk</span> <a name="l00197"></a>00197 <a name="l00198"></a>00198 <span class="preprocessor">#endif // __itkLoggerBase_h</span> <a name="l00199"></a>00199 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Thu May 7 23:26:53 2009 for ITK by <a href="http://www.stack.nl/~dimitri/doxygen/index.html"> <img src="http://www.stack.nl/~dimitri/doxygen/doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53> </a> 1.5.9 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2000</small></address> </body> </html>