Files
jak-project/game/main.cpp
T
doctashay 953e7c1ad5 Temp fix for spdlog + initial log to file implementation
Reduces verbose output by logging additional information to logs/game.log.
2020-10-06 16:03:33 -06:00

28 lines
804 B
C++

/*!
* @file main.cpp
* Main for the game. Launches the runtime.
*/
#include <cstdio>
#include "runtime.h"
#include "common/versions.h"
#include "third-party/spdlog/include/spdlog/spdlog.h"
#include "third-party/spdlog/include/spdlog/sinks/basic_file_sink.h"
int main(int argc, char** argv) {
while (true) {
spdlog::set_level(spdlog::level::debug);
auto my_logger = spdlog::basic_logger_mt("GOAL Runtime", "logs/game.log");
spdlog::set_default_logger(my_logger);
spdlog::flush_on(spdlog::level::info);
// run the runtime in a loop so we can reset the game and have it restart cleanly
printf("\n");
spdlog::info("gk {}.{} OK!", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR);
if (exec_runtime(argc, argv) == 2) {
return 0;
}
}
return 0;
}