add GetAdditionalLog

This commit is contained in:
Glenn Maynard
2003-07-22 05:05:39 +00:00
parent 439b7c45e5
commit fdd00f5dd4
2 changed files with 16 additions and 0 deletions
+14
View File
@@ -213,15 +213,29 @@ void RageLog::Flush()
fflush( m_fileInfo );
}
static char g_AdditionalLogStr[10240] = "";
static int g_AdditionalLogSize = 0;
void RageLog::UpdateMappedLog()
{
CString str;
for(map<CString, CString>::const_iterator i = LogMaps.begin(); i != LogMaps.end(); ++i)
str += ssprintf("%s\n", i->second.c_str());
g_AdditionalLogSize = min( sizeof(g_AdditionalLogStr), str.size() );
memcpy( g_AdditionalLogStr, str.c_str(), g_AdditionalLogSize );
/* XXX: deprecated */
HOOKS->AdditionalLog(str);
}
void RageLog::GetAdditionalLog( const char* &p, int &size )
{
p = g_AdditionalLogStr;
size = g_AdditionalLogSize;
}
void RageLog::MapLog(const CString &key, const char *fmt, ...)
{
va_list va;
+2
View File
@@ -31,6 +31,8 @@ public:
void MapLog(const CString &key, const char *fmt, ...);
void UnmapLog(const CString &key);
static void GetAdditionalLog( const char* &p, int &size );
private:
FILE *m_fileLog, *m_fileInfo;
void Write( int, CString );