Add log timestamping. This lets us check the time when something

odd happens (eg. a skip), and see if anything happened in the log
at that time after we quit.
This commit is contained in:
Glenn Maynard
2003-03-07 04:48:13 +00:00
parent a2a774a3c2
commit 8d47a3e57e
3 changed files with 21 additions and 1 deletions
+5
View File
@@ -14,6 +14,8 @@
#include "StepMania.h" #include "StepMania.h"
#include "RageLog.h" #include "RageLog.h"
#include "RageUtil.h" #include "RageUtil.h"
#include "RageTimer.h"
#include "PrefsManager.h"
#include <fstream> #include <fstream>
#include <time.h> #include <time.h>
@@ -145,6 +147,9 @@ void RageLog::Warn( const char *fmt, ...)
/* When */ /* When */
void RageLog::Write( int where, CString str) void RageLog::Write( int where, CString str)
{ {
if( PREFSMAN && PREFSMAN->m_bTimestamping )
str = SecondsToTime(RageTimer::GetTimeSinceStart()) + ": " + str;
if( where&WRITE_TO_INFO && m_fileInfo ) if( where&WRITE_TO_INFO && m_fileInfo )
fprintf(m_fileInfo, "%s\n", str.GetString() ); fprintf(m_fileInfo, "%s\n", str.GetString() );
+14
View File
@@ -57,6 +57,14 @@ ScreenManager::ScreenManager()
m_textSystemMessage.SetZoom( 0.7f ); m_textSystemMessage.SetZoom( 0.7f );
// m_textSystemMessage.SetShadowLength( 2 ); // m_textSystemMessage.SetShadowLength( 2 );
m_textSystemMessage.SetDiffuse( RageColor(1,1,1,0) ); m_textSystemMessage.SetDiffuse( RageColor(1,1,1,0) );
m_textSysTime.LoadFromFont( THEME->GetPathTo("Fonts","normal") );
m_textSysTime.SetXY( 4.0f, 40.0f );
m_textSysTime.SetHorizAlign( Actor::align_left );
m_textSysTime.SetVertAlign( Actor::align_top );
m_textSysTime.SetZoom( 0.5f );
m_textSysTime.SetDiffuse( RageColor(1,0,1,1) );
m_textSysTime.EnableShadow(false);
} }
@@ -87,6 +95,7 @@ void ScreenManager::Update( float fDeltaTime )
m_textStats.Update( fDeltaTime ); m_textStats.Update( fDeltaTime );
for( int p=0; p<NUM_PLAYERS; p++ ) for( int p=0; p<NUM_PLAYERS; p++ )
m_textCreditInfo[p].Update( fDeltaTime ); m_textCreditInfo[p].Update( fDeltaTime );
m_textSysTime.Update( fDeltaTime );
EmptyDeleteQueue(); EmptyDeleteQueue();
@@ -152,6 +161,11 @@ void ScreenManager::Draw()
for( int p=0; p<NUM_PLAYERS; p++ ) for( int p=0; p<NUM_PLAYERS; p++ )
m_textCreditInfo[p].Draw(); m_textCreditInfo[p].Draw();
if(PREFSMAN->m_bTimestamping)
{
m_textSysTime.SetText( SecondsToTime(RageTimer::GetTimeSinceStart()) );
m_textSysTime.Draw();
}
} }
+1
View File
@@ -59,6 +59,7 @@ private:
BitmapText m_textStats; BitmapText m_textStats;
BitmapText m_textSystemMessage; BitmapText m_textSystemMessage;
BitmapText m_textCreditInfo[NUM_PLAYERS]; BitmapText m_textCreditInfo[NUM_PLAYERS];
BitmapText m_textSysTime;
Screen* MakeNewScreen( CString sClassName ); Screen* MakeNewScreen( CString sClassName );
void EmptyDeleteQueue(); void EmptyDeleteQueue();