summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2017-04-01 17:28:42 +0200
committerLukas Pioch <lukas@zgow.de>2017-06-03 21:40:35 +0200
commit832298e7aaee884393d8f80e5a374fa652b4cb68 (patch)
tree9b5c7af3b909f4a3616cfc1b32b36722f434ae60 /src/Root.cpp
parentFixed double chests (#3741) (diff)
downloadcuberite-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 '')
-rw-r--r--src/Root.cpp17
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 ---");