diff --git a/stepmania/src/RageLog.cpp b/stepmania/src/RageLog.cpp index b5cfde0692..c5827640b0 100644 --- a/stepmania/src/RageLog.cpp +++ b/stepmania/src/RageLog.cpp @@ -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 ); } diff --git a/stepmania/src/RageLog.h b/stepmania/src/RageLog.h index bf4793f68a..e4e299e8d7 100644 --- a/stepmania/src/RageLog.h +++ b/stepmania/src/RageLog.h @@ -8,11 +8,24 @@ class RageLog public: RageLog(); ~RageLog(); + + enum LogType + { + LogType_SongFile, // Refers to a sm, dwi, ksf, etc. file. + LogType_CourseFile, // Refers to a crs file. + LogType_EditFile, // Refers to an edit file. + LogType_SoundFile, // Refers to a .ogg, .mp3, .wav, etc. file. + LogType_GraphicFile, // Refers to a .jpg, .png, etc. file. + LogType_CacheFile, // Refers to any cache file. + LogType_Song, // Refers to an actual song (directory). + LogType_General, // Any other type of user log message. Ignores sPath. + NUM_LogType + }; 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 UserLog( const char *fmt, ... ) PRINTF(2,3); + void UserLog( LogType lt, const RString &sPath, const char *fmt, ... ) PRINTF(4,5); void Flush(); void MapLog( const RString &key, const char *fmt, ... ) PRINTF(3,4);