mirror of
https://github.com/debauchee/barrier.git
synced 2026-11-27 22:32:02 +08:00
Reduced code duplication (setup file logging)
This commit is contained in:
@@ -491,13 +491,7 @@ CClientApp::mainLoop()
|
||||
// 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();
|
||||
|
||||
// create socket multiplexer. this must happen after daemonization
|
||||
// on unix because threads evaporate across a fork().
|
||||
@@ -532,11 +526,6 @@ CClientApp::mainLoop()
|
||||
updateStatus();
|
||||
LOG((CLOG_NOTE "stopped client"));
|
||||
|
||||
if (fileLog) {
|
||||
CLOG->remove(fileLog);
|
||||
delete fileLog;
|
||||
}
|
||||
|
||||
return kExitSuccess;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user