mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
9bbb47006c
Logging names are now less ambiguous. We can adopt one of two styling conventions: create a logger object for each component of the project, and log every output into a large jak.log file; or we can have separate text files for the compiler log, runtime log, etc. I think the former will be the most efficient but may also make filtering harder. Also replaced more old prints with spdlog equivalents
27 lines
793 B
C++
27 lines
793 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 game_logger = spdlog::basic_logger_mt("GOAL Runtime", "logs/runtime.log");
|
|
spdlog::set_default_logger(game_logger);
|
|
spdlog::flush_on(spdlog::level::info);
|
|
|
|
// run the runtime in a loop so we can reset the game and have it restart cleanly
|
|
spdlog::info("gk {}.{} OK!", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR);
|
|
|
|
if (exec_runtime(argc, argv) == 2) {
|
|
return 0;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|