Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions engine/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,29 @@ int main(int argc, char* argv[]) {
RunServer();
return 0;
} else {
auto config = file_manager_utils::GetCortexConfig();
std::filesystem::create_directories(
std::filesystem::path(config.logFolderPath) /
std::filesystem::path(cortex_utils::logs_folder));
trantor::FileLogger asyncFileLogger;
asyncFileLogger.setFileName(config.logFolderPath + "/" +
cortex_utils::logs_cli_base_name);
asyncFileLogger.setMaxLines(
config.maxLogLines); // Keep last 100000 lines
asyncFileLogger.startLogging();
trantor::Logger::setOutputFunction(
[&](const char* msg, const uint64_t len) {
asyncFileLogger.output_(msg, len);
},
[&]() { asyncFileLogger.flush(); });
bool verbose = false;
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], "--verbose") == 0) {
verbose = true;
}
}
if (!verbose) {
auto config = file_manager_utils::GetCortexConfig();
std::filesystem::create_directories(
std::filesystem::path(config.logFolderPath) /
std::filesystem::path(cortex_utils::logs_folder));
trantor::FileLogger asyncFileLogger;
asyncFileLogger.setFileName(config.logFolderPath + "/" +
cortex_utils::logs_cli_base_name);
asyncFileLogger.setMaxLines(
config.maxLogLines); // Keep last 100000 lines
asyncFileLogger.startLogging();
trantor::Logger::setOutputFunction(
[&](const char* msg, const uint64_t len) {
asyncFileLogger.output_(msg, len);
},
[&]() { asyncFileLogger.flush(); });
}
CommandLineParser clp;
clp.SetupCommand(argc, argv);
return 0;
Expand Down