remove HRESULT log and exception ctors; use hr_ssprintf instead

This commit is contained in:
Glenn Maynard
2002-12-09 22:25:57 +00:00
parent bee3937d59
commit fddcc849b2
4 changed files with 3 additions and 34 deletions
+3 -20
View File
@@ -14,25 +14,19 @@
#include "RageUtil.h"
#include <fstream>
//#include "crash.h"
#include "dxerr8.h"
#pragma comment(lib, "DxErr8.lib")
#include "crash.h"
RageLog* LOG; // global and accessable from anywhere in the program
// constants
#define LOG_FILE_NAME "log.txt"
RageLog::RageLog()
{
// delete old log files
DeleteFile( LOG_FILE_NAME );
// Open log file and leave it open. Let the OS close it when the app exits
// Open log file and leave it open.
m_fileLog = fopen( LOG_FILE_NAME, "w" );
SYSTEMTIME st;
@@ -76,24 +70,13 @@ void RageLog::Trace( const char *fmt, ...)
fprintf( m_fileLog, "%s\n", sBuff.GetString() );
printf( "%s\n", sBuff.GetString() );
// CrashLog(sBuff);
CrashLog(sBuff);
#ifdef DEBUG
this->Flush(); // implicit flush
#endif
}
void RageLog::Trace( HRESULT hr, const char *fmt, ...)
{
va_list va;
va_start(va, fmt);
CString s = vssprintf( fmt, va );
va_end(va);
s += ssprintf( "(%s)", DXGetErrorString8(hr) );
this->Trace( "%s", s.GetString() );
}
void RageLog::Warn( const char *fmt, ...)
{
va_list va;