comparison src/main.cpp @ 754:4ec2ac09969d

Renamed the logger class and put it into a namespace for later universal tool reuse. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@1031 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Tue, 21 Dec 2010 23:07:50 +0000
parents e64c04dc6f61
children 5a0ece4b81b4
comparison
equal deleted inserted replaced
753:e64c04dc6f61 754:4ec2ac09969d
18 ***************************************************************************/ 18 ***************************************************************************/
19 19
20 #include "MainWindow.h" 20 #include "MainWindow.h"
21 21
22 #include "UiGuiIndentServer.h" 22 #include "UiGuiIndentServer.h"
23 #include "UiGuiLogger.h" 23 #include "debugging/TSLogger.h"
24 #include "UiGuiIniFileParser.h" 24 #include "UiGuiIniFileParser.h"
25 #include "UiGuiSettings.h" 25 #include "UiGuiSettings.h"
26 #include "UiGuiVersion.h" 26 #include "UiGuiVersion.h"
27 #include "UiGuiSystemInfo.h" 27 #include "UiGuiSystemInfo.h"
28 #include "IndentHandler.h" 28 #include "IndentHandler.h"
100 100
101 return true; 101 return true;
102 } 102 }
103 #endif 103 #endif
104 104
105 105 using namespace tschweitzer::debugging;
106 106
107 /*! 107 /*!
108 /brief Entry point to UniversalIndentGUI application. 108 /brief Entry point to UniversalIndentGUI application.
109 109
110 Evaluates the following parameters: 110 Evaluates the following parameters:
215 215
216 // Init and install the logger function. 216 // Init and install the logger function.
217 // Setting UTF-8 as default 8-Bit encoding to ensure that qDebug does no false string conversion. 217 // Setting UTF-8 as default 8-Bit encoding to ensure that qDebug does no false string conversion.
218 QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF-8") ); 218 QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF-8") );
219 QTextCodec::setCodecForLocale( QTextCodec::codecForName("UTF-8") ); 219 QTextCodec::setCodecForLocale( QTextCodec::codecForName("UTF-8") );
220 // Force creation of an UiGuiLogger instance here, to avoid recursion with SettingsPaths init function. 220 // Force creation of an TSLogger instance here, to avoid recursion with SettingsPaths init function.
221 #ifdef _DEBUG 221 #ifdef _DEBUG
222 UiGuiLogger::getInstance(0); 222 TSLogger::getInstance(0);
223 #else 223 #else
224 UiGuiLogger::getInstance(verboseLevel); 224 TSLogger::getInstance(verboseLevel);
225 #endif 225 #endif
226 qInstallMsgHandler( UiGuiLogger::messageHandler ); 226 qInstallMsgHandler( TSLogger::messageHandler );
227 UiGuiLogger::messageHandler( UiGuiInfoMsg, QString("Starting UiGUI Version %1 %2").arg(PROGRAM_VERSION_STRING).arg(PROGRAM_REVISION).toAscii() ); 227 TSLogger::messageHandler( TSLoggerInfoMsg, QString("Starting UiGUI Version %1 %2").arg(PROGRAM_VERSION_STRING).arg(PROGRAM_REVISION).toAscii() );
228 UiGuiLogger::messageHandler( UiGuiInfoMsg, QString("Running on %1").arg(UiGuiSystemInfo::getOperatingSystem()).toAscii() ); 228 TSLogger::messageHandler( TSLoggerInfoMsg, QString("Running on %1").arg(UiGuiSystemInfo::getOperatingSystem()).toAscii() );
229 229
230 // Set default values for all by UniversalIndentGUI used settings objects. 230 // Set default values for all by UniversalIndentGUI used settings objects.
231 QCoreApplication::setOrganizationName("UniversalIndentGUI"); 231 QCoreApplication::setOrganizationName("UniversalIndentGUI");
232 QCoreApplication::setOrganizationDomain("universalindent.sf.net"); 232 QCoreApplication::setOrganizationDomain("universalindent.sf.net");
233 QCoreApplication::setApplicationName("UniversalIndentGUI"); 233 QCoreApplication::setApplicationName("UniversalIndentGUI");
255 255
256 delete indentHandler; 256 delete indentHandler;
257 delete mainWindow; 257 delete mainWindow;
258 258
259 SettingsPaths::cleanAndRemoveTempDir(); 259 SettingsPaths::cleanAndRemoveTempDir();
260 UiGuiLogger::deleteInstance(); 260 TSLogger::deleteInstance();
261 261
262 return returnValue; 262 return returnValue;
263 } 263 }