Change the UserLog() to output a more consistent message.

This commit is contained in:
Steve Checkoway
2006-09-04 08:09:05 +00:00
parent 1ebea3ccf5
commit dae47979ea
2 changed files with 42 additions and 2 deletions
+28 -1
View File
@@ -227,13 +227,40 @@ void RageLog::Warn( const char *fmt, ... )
Write( WRITE_TO_INFO | WRITE_LOUD, sBuff );
}
void RageLog::UserLog( const char *fmt, ... )
static const char *const LogTypeNames[] = {
"Song file",
"Course file",
"Edit file",
"Sound file",
"Graphic file",
"Cache file",
"Song",
NULL, // General, not used.
};
void RageLog::UserLog( LogType lt, const RString &sPath, const char *fmt, ... )
{
va_list va;
va_start( va, fmt );
RString sBuf = vssprintf( fmt, va );
va_end( va );
switch( lt )
{
case LogType_SongFile:
case LogType_CourseFile:
case LogType_EditFile:
case LogType_SoundFile:
case LogType_GraphicFile:
case LogType_CacheFile:
case LogType_Song:
sBuf = ssprintf( "%s \"%s\" %s", LogTypeNames[lt], sPath.c_str(), sBuf.c_str() );
break;
case LogType_General:
break;
DEFAULT_FAIL( lt );
}
Write( WRITE_TO_USER_LOG, sBuf );
}