TestEgk 1.5l1 :

- aggiornamento a VS2013
- da INI ridefinibile path per file log.
This commit is contained in:
Dario Sassi
2014-12-17 15:23:42 +00:00
parent 51bee5fc83
commit 41563df19c
3 changed files with 17 additions and 16 deletions
+11 -14
View File
@@ -52,39 +52,36 @@ using namespace egtlogger ;
int
wmain( int argc, wchar_t* argv[])
{
int nErr ;
int nDebug ;
string sIn ;
string sExeDir ;
string sFileIni ;
// se debug, imposto stampe memory leaks all'uscita
#ifdef _DEBUG
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF) ;
#endif
// recupero il direttorio del programma e costruisco path file INI
string sExeDir ;
GetModuleDirectory( NULL, sExeDir) ;
sFileIni = sExeDir + "\\TestEgk.ini" ;
string sFileIni = sExeDir + "\\TestEgk.ini" ;
// imposto direttorio di lavoro
SetCurrentDirectory( sExeDir) ;
// interpreto i parametri di linea
// nome file di comandi
// nome file di comandi
string sIn ;
if ( argc >= 2)
sIn = LPSTR( WtoA( argv[1])) ;
else
sIn = GetPrivateProfileStringUtf8( "General", "Batch", "In.btsc", sFileIni.c_str()) ;
// livello di debug
nDebug = GetPrivateProfileInt( "General", "Debug", 0, sFileIni.c_str()) ;
// livello di debug
int nDebug = GetPrivateProfileInt( "General", "Debug", 0, sFileIni.c_str()) ;
// file di log
string sLog = GetPrivateProfileStringUtf8( "General", "Log", "TestEgk.log", sFileIni.c_str()) ;
// inizializzazioni del logger
Logger logger( ( nDebug > 0 ? LL_DEBUG : LL_INFO), "TestEGk") ;
logger.AddOutputStream( cout, false, LL_INFO) ;
logger.AddOutputStream( new(nothrow) ofstream( "TestEgk.log"), true) ;
logger.AddOutputStream( new(nothrow) ofstream( sLog), true) ;
// inizio programma
LOG_DATETIME( &logger, " Start Test")
@@ -117,7 +114,7 @@ wmain( int argc, wchar_t* argv[])
InitFontManager( sNfeFontDir, sDefaultFont) ;
// nessun errore
nErr = 0 ;
int nErr = 0 ;
// esecuzione script
PtrOwner<IGeomDB> pGdb( CreateGeomDB()) ;