add GetAdditionalLog
This commit is contained in:
@@ -213,15 +213,29 @@ void RageLog::Flush()
|
|||||||
fflush( m_fileInfo );
|
fflush( m_fileInfo );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static char g_AdditionalLogStr[10240] = "";
|
||||||
|
static int g_AdditionalLogSize = 0;
|
||||||
|
|
||||||
void RageLog::UpdateMappedLog()
|
void RageLog::UpdateMappedLog()
|
||||||
{
|
{
|
||||||
CString str;
|
CString str;
|
||||||
for(map<CString, CString>::const_iterator i = LogMaps.begin(); i != LogMaps.end(); ++i)
|
for(map<CString, CString>::const_iterator i = LogMaps.begin(); i != LogMaps.end(); ++i)
|
||||||
str += ssprintf("%s\n", i->second.c_str());
|
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);
|
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, ...)
|
void RageLog::MapLog(const CString &key, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list va;
|
va_list va;
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ public:
|
|||||||
void MapLog(const CString &key, const char *fmt, ...);
|
void MapLog(const CString &key, const char *fmt, ...);
|
||||||
void UnmapLog(const CString &key);
|
void UnmapLog(const CString &key);
|
||||||
|
|
||||||
|
static void GetAdditionalLog( const char* &p, int &size );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FILE *m_fileLog, *m_fileInfo;
|
FILE *m_fileLog, *m_fileInfo;
|
||||||
void Write( int, CString );
|
void Write( int, CString );
|
||||||
|
|||||||
Reference in New Issue
Block a user