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 "RageLog.h"
#include "RageUtil.h"
#include "RageTimer.h"
#include "PrefsManager.h"
#include <fstream>
#include <time.h>
@@ -145,6 +147,9 @@ void RageLog::Warn( const char *fmt, ...)
/* When */
void RageLog::Write( int where, CString str)
{
if( PREFSMAN && PREFSMAN->m_bTimestamping )
str = SecondsToTime(RageTimer::GetTimeSinceStart()) + ": " + str;
if( where&WRITE_TO_INFO && m_fileInfo )
fprintf(m_fileInfo, "%s\n", str.GetString() );