diff --git a/src/TConsole.cpp b/src/TConsole.cpp index 827881c..79d30a4 100644 --- a/src/TConsole.cpp +++ b/src/TConsole.cpp @@ -369,10 +369,6 @@ TConsole::TConsole() { mCommandline.set_history_limit(20); mCommandline.set_prompt("> "); BackupOldLog(); - bool success = mCommandline.enable_write_to_file("Server.log"); - if (!success) { - beammp_error("unable to open file for writing: \"Server.log\""); - } mCommandline.on_command = [this](Commandline& c) { try { auto cmd = c.get_command(); diff --git a/src/main.cpp b/src/main.cpp index a1c9354..8b2f3c5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -77,6 +77,7 @@ int main(int argc, char** argv) { int BeamMPServerMain(MainArguments Arguments) { setlocale(LC_ALL, "C"); + Application::InitializeConsole(); ArgsParser Parser; Parser.RegisterArgument({ "help" }, ArgsParser::NONE); Parser.RegisterArgument({ "version" }, ArgsParser::NONE); @@ -116,9 +117,12 @@ int BeamMPServerMain(MainArguments Arguments) { } } } - - Application::InitializeConsole(); + Application::SetSubsystemStatus("Main", Application::Status::Starting); + bool Success = Application::Console().Internal().enable_write_to_file("Server.log"); + if (!Success) { + beammp_error("unable to open file for writing: \"Server.log\""); + } SetupSignalHandlers();