Main Page | Class List | File List | Class Members

E:/Projekte/Open Source/Unwritten/Unwritten C++/projects/Library/include/UnwrittenLogfileManager.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(_UNWRITTENLOGFILEMANAGER_HPP_)
00021         #define _UNWRITTENLOGFILEMANAGER_HPP_
00022 
00023         //
00024         // needed Unwritten includes
00025         //
00026         #include <Unwritten.hpp>
00027         #include <UnwrittenLogfile.hpp>
00028 
00029         //
00030         // other needed includes
00031         //
00032         #include <string>
00033         #include <map>
00034 
00044         class UNWRITTEN_API UnwrittenLogfileManager
00045         {
00046                 public:
00051                         static UnwrittenLogfileManager * GetInstance();
00052 
00058                         UnwrittenLogfile * GetLogfile( const std::string & szFilename );
00059 
00065                         void CloseLogfile( const UnwrittenLogfile * pLogfile );
00066 
00071                         void CloseLogfile( const std::string & szFilename );
00072 
00081                         void WriteToAllFiles( UnwrittenLogfile::UnwrittenLoggingType typeOfMsg, const std::string & szText, bool bNewLine = true );
00082                         
00086                         void FlushAllFiles();
00087 
00092                         void ShouldPrintMessageType( bool bShouldShow );
00093 
00098                         bool ShouldPrintMessageType( );
00099 
00104                         size_t GetManagedLogfiles();
00105 
00110                         void SetDefaultLoggingType( UnwrittenLogfile::UnwrittenLoggingType newDefaultType );
00111 
00116                         UnwrittenLogfile::UnwrittenLoggingType GetDefaultLoggingType();
00117 
00118                 protected:
00119 
00123                         UnwrittenLogfileManager();
00124 
00128                         virtual ~UnwrittenLogfileManager();
00129 
00130                 private:
00134                         static UnwrittenLogfileManager * m_pInstance;
00135 
00139                         std::map< std::string, class UnwrittenLogfile * > m_pLogfiles;
00140 
00144                         UnwrittenLogfile::UnwrittenLoggingType m_eDefaultLoggingType;
00145 
00149                         bool m_bPrintMessageType;
00150         };
00151 
00152 #endif

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