better logging
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "RageFile.h"
|
#include "RageFile.h"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include "ProductInfo.h"
|
||||||
|
|
||||||
RageLog* LOG; // global and accessable from anywhere in the program
|
RageLog* LOG; // global and accessable from anywhere in the program
|
||||||
|
|
||||||
@@ -97,8 +98,10 @@ RageLog::RageLog()
|
|||||||
if( m_fileInfo == NULL )
|
if( m_fileInfo == NULL )
|
||||||
RageException::Throw( " Couldn't open info.txt: %s", strerror(errno) );
|
RageException::Throw( " Couldn't open info.txt: %s", strerror(errno) );
|
||||||
|
|
||||||
|
this->Info( PRODUCT_NAME_VER );
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
this->Trace( "Last compiled on %s.", __TIMESTAMP__ );
|
this->Info( "Last compiled on %s.", __TIMESTAMP__ );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
time_t cur_time;
|
time_t cur_time;
|
||||||
|
|||||||
@@ -324,10 +324,14 @@ RageDisplay *CreateDisplay()
|
|||||||
#else
|
#else
|
||||||
CString sVideoDriver = "OpenGL";
|
CString sVideoDriver = "OpenGL";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
LOG->Log( "Last seen video driver: " + PREFSMAN->m_sLastSeenVideoDriver );
|
||||||
|
|
||||||
if( PREFSMAN->m_sVideoRenderers == "" ||
|
if( PREFSMAN->m_sVideoRenderers == "" ||
|
||||||
PREFSMAN->m_sLastSeenVideoDriver != sVideoDriver )
|
PREFSMAN->m_sLastSeenVideoDriver != sVideoDriver )
|
||||||
{
|
{
|
||||||
// Apply default graphic settings for this card
|
LOG->Log( "Video card has changed. Applying new defaults." );
|
||||||
|
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.SetPath( VIDEOCARDS_INI_PATH );
|
ini.SetPath( VIDEOCARDS_INI_PATH );
|
||||||
if(!ini.ReadFile())
|
if(!ini.ReadFile())
|
||||||
@@ -345,7 +349,7 @@ RageDisplay *CreateDisplay()
|
|||||||
if( !regex.Compare(sVideoDriver) )
|
if( !regex.Compare(sVideoDriver) )
|
||||||
continue; // skip
|
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.GetValue( sKey, "Renderers", PREFSMAN->m_sVideoRenderers );
|
||||||
ini.GetValueI( sKey, "Width", PREFSMAN->m_iDisplayWidth );
|
ini.GetValueI( sKey, "Width", PREFSMAN->m_iDisplayWidth );
|
||||||
@@ -387,6 +391,8 @@ RageDisplay *CreateDisplay()
|
|||||||
" PLEASE DO NOT FILE THIS ERROR AS A BUG!\n\n"
|
" PLEASE DO NOT FILE THIS ERROR AS A BUG!\n\n"
|
||||||
"Video Driver: "+sVideoDriver+"\n\n";
|
"Video Driver: "+sVideoDriver+"\n\n";
|
||||||
|
|
||||||
|
LOG->Info( "Trying video renderers: '%s'", PREFSMAN->m_sVideoRenderers.c_str() );
|
||||||
|
|
||||||
CStringArray asRenderers;
|
CStringArray asRenderers;
|
||||||
split( PREFSMAN->m_sVideoRenderers, ",", asRenderers, true );
|
split( PREFSMAN->m_sVideoRenderers, ",", asRenderers, true );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user