Logger.inl

Go to the documentation of this file.
00001 #ifndef ORO_CORELIB_LOGGER_INL
00002 #define ORO_CORELIB_LOGGER_INL
00003 
00012 namespace RTT
00013 {
00014 
00015     template< class T>
00016     Logger& Logger::operator<<( T t ) {
00017 #ifndef OROBLD_DISABLE_LOGGING
00018         if ( !mayLog() )
00019             return *this;
00020         std::stringstream tmp;
00021         tmp << t;
00022         return this->operator<<( tmp.str() );
00023 #endif
00024         return *this;
00025     }
00026 
00027 #ifdef OROBLD_DISABLE_LOGGING
00028 
00029     // instance will be actually null
00030     inline Logger& Logger::log() {
00031         return *_instance;
00032     }
00033 
00034     inline Logger& Logger::log(LogLevel) {
00035         return *_instance;
00036     }
00037 
00038     inline bool Logger::mayLog() const {
00039         return false;
00040     }
00041 
00042     inline void Logger::allowRealTime() {
00043     }
00044 
00045     inline void Logger::disallowRealTime() {
00046     }
00047 
00048     inline std::ostream&
00049     Logger::nl(std::ostream& __os)
00050     {
00051         return __os;
00052     }
00053 
00054     inline std::ostream&
00055     Logger::endl(std::ostream& __os)
00056     {
00057         return __os;
00058     }
00059 
00060     inline std::ostream&
00061     Logger::flush(std::ostream& __os)
00062     {
00063         return __os;
00064     }
00065 
00066 
00067     inline Logger::In::In(const char*)
00068     {
00069     }
00070 
00071     inline Logger::In::~In() 
00072     {
00073     }
00074 
00075     inline Logger& Logger::in(const char*) 
00076     {
00077         return *this;
00078     }
00079 
00080     inline Logger& Logger::out()
00081     {
00082         return *this;
00083     }
00084 
00085     inline const char* Logger::getLogModule() const {
00086         return "";
00087     }
00088 
00089     inline void Logger::startup() {
00090     }
00091 
00092     inline void Logger::shutdown() {
00093     }
00094 
00095     inline std::string Logger::getLogLine() {
00096         return "";
00097     }
00098 
00099     inline void Logger::setStdStream( std::ostream& ) {
00100     }
00101 
00102     inline Logger& Logger::operator<<( const char* ) {
00103         return *this;
00104     }
00105 
00106     inline Logger& Logger::operator<<( const std::string& ) {
00107         return *this;
00108     }
00109 
00110     inline Logger& Logger::operator<<(LogLevel) {
00111         return *this;
00112     }
00113 
00114     inline Logger& Logger::operator<<(std::ostream& (*pf)(std::ostream&))
00115     {
00116         return *this;
00117     }
00118 
00119     inline void Logger::logflush() {
00120      }
00121 
00122     inline void Logger::lognl() {
00123      }
00124 
00125     inline void Logger::logendl() {
00126      }
00127 
00128     inline void Logger::setLogLevel( LogLevel ) {
00129     }
00130 
00131     inline Logger::LogLevel Logger::getLogLevel() const {
00132         return Never;
00133     }
00134 #endif
00135 
00136 }
00137 
00138 #endif

Generated on Tue Mar 25 17:41:47 2008 for OrocosReal-TimeToolkit by  doxygen 1.5.3