Files
itgmania212121/stepmania/src/RageLog.h
T

54 lines
1.5 KiB
C++
Raw Normal View History

#ifndef RAGELOG_H
#define RAGELOG_H
2002-05-01 19:14:55 +00:00
/*
-----------------------------------------------------------------------------
Class: RageLog
Desc: Manages logging
2002-05-19 01:59:48 +00:00
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
2002-05-01 19:14:55 +00:00
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);
2002-05-01 19:14:55 +00:00
void Flush();
2003-12-29 23:37:55 +00:00
void MapLog( const CString &key, const char *fmt, ... ) PRINTF(3,4);
void UnmapLog( const CString &key );
2003-04-22 05:21:25 +00:00
static const char *GetAdditionalLog();
static const char *GetInfo();
/* Returns NULL if past the last recent log. */
static const char *GetRecentLog( int n );
2003-07-22 05:05:39 +00:00
2004-02-27 00:56:51 +00:00
void SetShowLogOutput( bool show ); // enable or disable logging to stdout
void SetLogToDisk( bool b ); // enable or disable logging to file
2004-03-04 04:27:55 +00:00
void SetInfoToDisk( bool b ); // enable or disable logging info.txt to file
2003-10-02 03:11:35 +00:00
void SetFlushing( bool b ); // enable or disable flushing
2003-10-02 03:13:51 +00:00
void SetTimestamping( bool b ); // enable or disable timestamping
2003-01-24 01:35:15 +00:00
private:
2004-02-27 00:56:51 +00:00
bool m_bLogToDisk;
2004-03-04 04:27:55 +00:00
bool m_bInfoToDisk;
2003-10-02 03:11:35 +00:00
bool m_bFlush;
2003-10-02 03:13:51 +00:00
bool m_bTimestamping;
bool m_bShowLogOutput;
2003-12-29 23:37:55 +00:00
void Write( int, const CString &str );
2003-04-22 05:21:25 +00:00
void UpdateMappedLog();
2003-12-29 23:37:55 +00:00
void AddToInfo( const CString &buf );
void AddToRecentLogs( const CString &buf );
2002-05-01 19:14:55 +00:00
};
2003-04-22 05:53:18 +00:00
extern RageLog* LOG; // global and accessable from anywhere in our program
2002-11-16 06:56:25 +00:00
#endif