00001 // -*- c++ -*- 00002 //------------------------------------------------------------------------------ 00003 // $Id: StdOutLogger.h,v 1.3 2003/07/25 02:51:47 vlg Exp $ 00004 //------------------------------------------------------------------------------ 00005 // StdOutLogger.h 00006 //------------------------------------------------------------------------------ 00007 // Copyright (c) 2001 by Vladislav Grinchenko 00008 // 00009 // This library is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU Library General Public 00011 // License as published by the Free Software Foundation; either 00012 // version 2 of the License, or (at your option) any later version. 00013 //------------------------------------------------------------------------------ 00014 // Created: 10/31/2001 00015 //------------------------------------------------------------------------------ 00016 #ifndef STDOUT_LOGGER_H 00017 #define STDOUT_LOGGER_H 00018 00019 #include <fstream> 00020 #include <string> 00021 #include <iostream> 00022 00023 #include "assa/Logger_Impl.h" 00024 00025 namespace ASSA { 00026 00032 class StdOutLogger : public Logger_Impl 00033 { 00034 public: 00035 StdOutLogger () { /*empty*/ } 00036 00037 virtual int log_open (u_long groups_); 00038 virtual int log_close (void); 00039 00040 virtual int log_msg (Group g_, 00041 size_t indent_level_, 00042 const string& func_name_, 00043 size_t expected_sz_, 00044 const char* fmt_, va_list); 00045 00046 virtual int log_func (Group g_, 00047 size_t indent_level_, 00048 const string& func_name_, 00049 marker_t type_); 00050 virtual void log_resync (); 00051 00052 private: 00053 StdOutLogger (const StdOutLogger&); 00054 StdOutLogger& operator= (const StdOutLogger&); 00055 }; 00056 00057 /******************************************************************************* 00058 Inline member functions 00059 *******************************************************************************/ 00060 inline int 00061 StdOutLogger:: 00062 log_open (u_long groups_) 00063 { 00064 m_groups = groups_; 00065 return 0; 00066 } 00067 00068 inline int 00069 StdOutLogger:: 00070 log_close (void) 00071 { 00072 return 0; 00073 } 00074 00075 inline void 00076 StdOutLogger:: 00077 log_resync () 00078 { 00079 std::cout << std::flush; 00080 } 00081 00082 00083 } // end namespace ASSA 00084 00085 #endif /* STDERR_LOGGER_H */