Move warnings meant for the user to userlog.txt. These are as inconsistent in format as before but at least they're all in one place.

This commit is contained in:
Steve Checkoway
2006-09-03 05:16:09 +00:00
parent c6eb78a3cf
commit 4606d68fdf
14 changed files with 158 additions and 137 deletions
+14 -15
View File
@@ -236,7 +236,7 @@ bool Song::LoadFromSongDir( RString sDir )
}
else
{
LOG->Warn( "Couldn't find any SM, DWI, BMS, or KSF files in '%s'.", sDir.c_str() );
LOG->UserLog( "Couldn't find any SM, DWI, BMS, or KSF files in '%s'.", sDir.c_str() );
vector<RString> vs;
GetDirListing( sDir + "*.mp3", vs, false, false );
@@ -245,7 +245,7 @@ bool Song::LoadFromSongDir( RString sDir )
if( !bHasMusic )
{
LOG->Warn( "No music file in this directory either. Ignoring this song directory." );
LOG->UserLog( "No music file in this directory either. Ignoring this song directory." );
return false;
}
@@ -277,7 +277,7 @@ bool Song::LoadFromSongDir( RString sDir )
if( !m_bHasMusic )
{
LOG->Trace( "Song \"%s\" ignored (no music)", sDir.c_str() );
LOG->UserLog( "Song \"%s\" ignored (no music)", sDir.c_str() );
return false; // don't load this song
}
@@ -349,7 +349,7 @@ void Song::TidyUpData()
* (which have no music file, per se) but it's something of a hack. */
if( Sample == NULL && m_sMusicFile != "" )
{
LOG->Warn( "Error opening sound \"%s\": %s", GetMusicPath().c_str(), error.c_str() );
LOG->UserLog( "Error opening sound \"%s\": %s", GetMusicPath().c_str(), error.c_str() );
/* Don't use this file. */
m_sMusicFile = "";
@@ -366,19 +366,19 @@ void Song::TidyUpData()
}
else if( m_fMusicLengthSeconds == 0 )
{
LOG->Warn( "File %s is empty?", GetMusicPath().c_str() );
LOG->UserLog( "File \"%s\" is empty?", GetMusicPath().c_str() );
}
}
}
else // ! HasMusic()
{
m_fMusicLengthSeconds = 100; // guess
LOG->Warn("Song \"%s\" has no music file; guessing at %f seconds", this->GetSongDir().c_str(), m_fMusicLengthSeconds);
LOG->UserLog( "Song \"%s\" has no music file; guessing at %f seconds", this->GetSongDir().c_str(), m_fMusicLengthSeconds );
}
if(m_fMusicLengthSeconds < 0)
if( m_fMusicLengthSeconds < 0 )
{
LOG->Warn( "File %s has negative length? (%f)", GetMusicPath().c_str(), m_fMusicLengthSeconds );
LOG->UserLog( "File %s has negative length? (%f)", GetMusicPath().c_str(), m_fMusicLengthSeconds );
m_fMusicLengthSeconds = 0;
}
@@ -403,10 +403,8 @@ void Song::TidyUpData()
if( m_Timing.m_BPMSegments.empty() )
{
/* XXX: Once we have a way to display warnings that the user actually
* cares about (unlike most warnings), this should be one of them. */
LOG->Warn( "No BPM segments specified in '%s%s', default provided.",
m_sSongDir.c_str(), m_sSongFileName.c_str() );
LOG->UserLog( "No BPM segments specified in '%s%s', default provided.",
m_sSongDir.c_str(), m_sSongFileName.c_str() );
m_Timing.AddBPMSegment( BPMSegment(0, 60) );
}
@@ -529,7 +527,7 @@ void Song::TidyUpData()
RageSurface *img = RageSurfaceUtils::LoadFile( sPath, error, true );
if( !img )
{
LOG->Trace( "Couldn't load '%s': %s", sPath.c_str(), error.c_str() );
LOG->UserLog( "Couldn't load '%s': %s", sPath.c_str(), error.c_str() );
continue;
}
@@ -741,9 +739,10 @@ void Song::Save()
if( !FileCopy( sOldPath, sNewPath ) )
{
LOG->Warn( "Backup of \"%s\" failed", sOldPath.c_str() );
LOG->UserLog( "Backup of \"%s\" failed", sOldPath.c_str() );
/* Don't remove. */
} else
}
else
FILEMAN->Remove( sOldPath );
}
}