mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-11 00:58:14 +08:00
Reduced code duplication (setup file logging)
This commit is contained in:
@@ -728,16 +728,7 @@ int CServerApp::mainLoop()
|
||||
// create the event queue
|
||||
CEventQueue eventQueue;
|
||||
|
||||
// logging to files
|
||||
CFileLogOutputter* fileLog = NULL;
|
||||
|
||||
if (args().m_logFile != NULL) {
|
||||
fileLog = new CFileLogOutputter(args().m_logFile);
|
||||
|
||||
CLOG->insert(fileLog);
|
||||
|
||||
LOG((CLOG_DEBUG1 "Logging to file (%s) enabled", args().m_logFile));
|
||||
}
|
||||
setupFileLogging();
|
||||
|
||||
// if configuration has no screens then add this system
|
||||
// as the default
|
||||
@@ -810,11 +801,6 @@ int CServerApp::mainLoop()
|
||||
updateStatus();
|
||||
LOG((CLOG_NOTE "stopped server"));
|
||||
|
||||
if (fileLog) {
|
||||
CLOG->remove(fileLog);
|
||||
delete fileLog;
|
||||
}
|
||||
|
||||
return kExitSuccess;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user