Main Page | Class List | File List | Class Members

E:/Projekte/Open Source/Unwritten/Unwritten C++/projects/Library/include/UnwrittenLogfile.hpp

00001 /*
00002  *  Unwritten - A distrubuted logging engine
00003  *  Copyright © 2005 by "The Unwritten Team"
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Lesser General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2.1 of the License, or (at your option) any later version.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  Lesser General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Lesser General Public
00016  *  License along with this library; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  **/
00019 
00020 #if !defined(_UNWRITTENLOGFILE_HPP_)
00021         #define _UNWRITTENLOGFILE_HPP_
00022 
00023         //
00024         // needed Unwritten includes
00025         //
00026         #include <Unwritten.hpp>
00027 
00028         //
00029         // other needed includes
00030         //
00031         #include <string>
00032         #include <stdio.h>
00033 
00043         class abstract UNWRITTEN_API UnwrittenLogfile
00044         {
00045                 public:
00052                         enum UnwrittenLoggingType
00053                         {
00054                                 UnwrittenDebug,       
00055                                 UnwrittenInformation, 
00056                                 UnwrittenWarning,     
00057                                 UnwrittenError        
00058                         };
00059 
00060 
00064                         friend class UnwrittenLogfileManager;
00065 
00075                         void Write( UnwrittenLoggingType typeOfMsg, const char * szText, ... );
00076 
00086                         void WriteLine( UnwrittenLoggingType typeOfMsg, const char * szText, ... );
00087 
00095                         UnwrittenLoggingType GetLoggingType();
00096 
00103                         void Flush();
00104 
00112                         void SetLoggingType( UnwrittenLoggingType newLoggingType );
00113 
00114                 protected:
00122                         UnwrittenLogfile( const std::string & szFilename, bool bPrintMessageType );
00123 
00128                         virtual ~UnwrittenLogfile();
00129 
00137                         virtual void Dispose();
00138 
00146                         void PrintMessageType( UnwrittenLoggingType typeOfMessage );
00147 
00148                 private:
00152                         std::string m_szLogfileName;
00153 
00157                         FILE * m_pFileHandle;
00158 
00162                         bool m_bDisposed;
00163 
00167                         UnwrittenLoggingType m_eLoggingType;
00168 
00172                         bool m_bPrintMessageType;
00173 
00177                         bool m_bWaitForNewLine;
00178         };
00179 
00180 #endif

Generated on Sun Feb 27 19:49:00 2005 for Unwritten - Independet Logging Library by  doxygen 1.4.1