Files
itgmania212121/stepmania/src/RageLog.h
T
2003-12-29 23:37:55 +00:00

53 lines
1.3 KiB
C++

#ifndef RAGELOG_H
#define RAGELOG_H
/*
-----------------------------------------------------------------------------
Class: RageLog
Desc: Manages logging
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
class RageLog
{
public:
RageLog();
~RageLog();
void Trace( const char *fmt, ...) PRINTF(2,3);
void Warn( const char *fmt, ...) PRINTF(2,3);
void Info( const char *fmt, ...) PRINTF(2,3);
void Flush();
void ShowLogOutput( bool show );
void MapLog( const CString &key, const char *fmt, ... ) PRINTF(3,4);
void UnmapLog( const CString &key );
static const char *GetAdditionalLog();
static const char *GetInfo();
/* Returns NULL if past the last recent log. */
static const char *GetRecentLog( int n );
void SetLogging( bool b ); // enable or disable logging
void SetFlushing( bool b ); // enable or disable flushing
void SetTimestamping( bool b ); // enable or disable timestamping
private:
bool m_bEnabled;
bool m_bFlush;
bool m_bTimestamping;
bool m_bShowLogOutput;
void Write( int, const CString &str );
void UpdateMappedLog();
void AddToInfo( const CString &buf );
void AddToRecentLogs( const CString &buf );
};
extern RageLog* LOG; // global and accessable from anywhere in our program
#endif