Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

RageLog.h

Go to the documentation of this file.
00001 /* 00002 * RageLog - Manages logging. 00003 */ 00004 00005 #ifndef RAGELOG_H 00006 #define RAGELOG_H 00007 00008 class RageLog 00009 { 00010 public: 00011 RageLog(); 00012 ~RageLog(); 00013 00014 void Trace( const char *fmt, ...) PRINTF(2,3); 00015 void Warn( const char *fmt, ...) PRINTF(2,3); 00016 void Info( const char *fmt, ...) PRINTF(2,3); 00017 void Flush(); 00018 00019 void MapLog( const CString &key, const char *fmt, ... ) PRINTF(3,4); 00020 void UnmapLog( const CString &key ); 00021 00022 static const char *GetAdditionalLog(); 00023 static const char *GetInfo(); 00024 /* Returns NULL if past the last recent log. */ 00025 static const char *GetRecentLog( int n ); 00026 00027 void SetShowLogOutput( bool show ); // enable or disable logging to stdout 00028 void SetLogToDisk( bool b ); // enable or disable logging to file 00029 void SetInfoToDisk( bool b ); // enable or disable logging info.txt to file 00030 void SetFlushing( bool b ); // enable or disable flushing 00031 00032 private: 00033 bool m_bLogToDisk; 00034 bool m_bInfoToDisk; 00035 bool m_bFlush; 00036 bool m_bShowLogOutput; 00037 void Write( int, const CString &str ); 00038 void UpdateMappedLog(); 00039 void AddToInfo( const CString &buf ); 00040 void AddToRecentLogs( const CString &buf ); 00041 }; 00042 00043 extern RageLog* LOG; // global and accessable from anywhere in our program 00044 #endif 00045 00046 /* 00047 * Copyright (c) 2001-2004 Chris Danford, Glenn Maynard 00048 * All rights reserved. 00049 * 00050 * Permission is hereby granted, free of charge, to any person obtaining a 00051 * copy of this software and associated documentation files (the 00052 * "Software"), to deal in the Software without restriction, including 00053 * without limitation the rights to use, copy, modify, merge, publish, 00054 * distribute, and/or sell copies of the Software, and to permit persons to 00055 * whom the Software is furnished to do so, provided that the above 00056 * copyright notice(s) and this permission notice appear in all copies of 00057 * the Software and that both the above copyright notice(s) and this 00058 * permission notice appear in supporting documentation. 00059 * 00060 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00061 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00062 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00063 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00064 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00065 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00066 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00067 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00068 * PERFORMANCE OF THIS SOFTWARE. 00069 */

Generated on Thu Jan 27 20:57:28 2005 for StepMania by doxygen 1.3.7