better logging

This commit is contained in:
Chris Danford
2003-08-12 06:50:42 +00:00
parent 16d52fa534
commit cd9fbf25f2
2 changed files with 12 additions and 3 deletions
+4 -1
View File
@@ -19,6 +19,7 @@
#include "PrefsManager.h"
#include "RageFile.h"
#include <time.h>
#include "ProductInfo.h"
RageLog* LOG; // global and accessable from anywhere in the program
@@ -97,8 +98,10 @@ RageLog::RageLog()
if( m_fileInfo == NULL )
RageException::Throw( " Couldn't open info.txt: %s", strerror(errno) );
this->Info( PRODUCT_NAME_VER );
#if defined(_MSC_VER)
this->Trace( "Last compiled on %s.", __TIMESTAMP__ );
this->Info( "Last compiled on %s.", __TIMESTAMP__ );
#endif
time_t cur_time;
+8 -2
View File
@@ -324,10 +324,14 @@ RageDisplay *CreateDisplay()
#else
CString sVideoDriver = "OpenGL";
#endif
LOG->Log( "Last seen video driver: " + PREFSMAN->m_sLastSeenVideoDriver );
if( PREFSMAN->m_sVideoRenderers == "" ||
PREFSMAN->m_sLastSeenVideoDriver != sVideoDriver )
{
// Apply default graphic settings for this card
LOG->Log( "Video card has changed. Applying new defaults." );
IniFile ini;
ini.SetPath( VIDEOCARDS_INI_PATH );
if(!ini.ReadFile())
@@ -345,7 +349,7 @@ RageDisplay *CreateDisplay()
if( !regex.Compare(sVideoDriver) )
continue; // skip
LOG->Trace( "Using default graphics settings for '%s'.", sDriverRegex.size()? sDriverRegex.c_str():"(unknown card)" );
LOG->Log( "Using default graphics settings for '%s'.", sDriverRegex.size()? sDriverRegex.c_str():"(unknown card)" );
ini.GetValue( sKey, "Renderers", PREFSMAN->m_sVideoRenderers );
ini.GetValueI( sKey, "Width", PREFSMAN->m_iDisplayWidth );
@@ -387,6 +391,8 @@ RageDisplay *CreateDisplay()
" PLEASE DO NOT FILE THIS ERROR AS A BUG!\n\n"
"Video Driver: "+sVideoDriver+"\n\n";
LOG->Info( "Trying video renderers: '%s'", PREFSMAN->m_sVideoRenderers.c_str() );
CStringArray asRenderers;
split( PREFSMAN->m_sVideoRenderers, ",", asRenderers, true );