diff options
author | worktycho <work.tycho@gmail.com> | 2017-04-01 17:28:42 +0200 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-06-03 21:40:35 +0200 |
commit | 832298e7aaee884393d8f80e5a374fa652b4cb68 (patch) | |
tree | 9b5c7af3b909f4a3616cfc1b32b36722f434ae60 /src/Root.cpp | |
parent | Fixed double chests (#3741) (diff) | |
download | cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.gz cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.bz2 cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.lz cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.xz cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.zst cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.zip |
Diffstat (limited to 'src/Root.cpp')
-rw-r--r-- | src/Root.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Root.cpp b/src/Root.cpp index c10bd09bd..a487310a8 100644 --- a/src/Root.cpp +++ b/src/Root.cpp @@ -116,14 +116,19 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo) auto consoleLogListener = MakeConsoleListener(m_RunAsService); auto consoleAttachment = cLogger::GetInstance().AttachListener(std::move(consoleLogListener)); - auto fileLogListenerRet = MakeFileListener(); - if (!fileLogListenerRet.first) + + cLogger::cAttachment fileAttachment; + if (!a_OverridesRepo->HasValue("Server","DisableLogFile")) { - m_TerminateEventRaised = true; - LOGERROR("Failed to open log file, aborting"); - return; + auto fileLogListenerRet = MakeFileListener(); + if (!fileLogListenerRet.first) + { + m_TerminateEventRaised = true; + LOGERROR("Failed to open log file, aborting"); + return; + } + fileAttachment = cLogger::GetInstance().AttachListener(std::move(fileLogListenerRet.second)); } - auto fileAttachment = cLogger::GetInstance().AttachListener(std::move(fileLogListenerRet.second)); LOG("--- Started Log ---"); |