Remove legacy LOADER log channel

This commit is contained in:
Nekotekina 2020-02-01 07:36:53 +03:00
parent d9a0619ddd
commit 3eca2d5d6c
17 changed files with 377 additions and 361 deletions

View file

@ -615,13 +615,13 @@ bool Emulator::BootRsxCapture(const std::string& path)
if (frame->magic != rsx::FRAME_CAPTURE_MAGIC)
{
LOG_ERROR(LOADER, "Invalid rsx capture file!");
sys_log.error("Invalid rsx capture file!");
return false;
}
if (frame->version != rsx::FRAME_CAPTURE_VERSION)
{
LOG_ERROR(LOADER, "Rsx capture file version not supported! Expected %d, found %d", rsx::FRAME_CAPTURE_VERSION, frame->version);
sys_log.error("Rsx capture file version not supported! Expected %d, found %d", rsx::FRAME_CAPTURE_VERSION, frame->version);
return false;
}
@ -947,7 +947,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
games.reset();
}
LOG_NOTICE(LOADER, "Path: %s", m_path);
sys_log.notice("Path: %s", m_path);
const std::string elf_dir = fs::get_parent_dir(m_path);
@ -998,14 +998,14 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (!_psf.empty() && m_cat.empty())
{
LOG_FATAL(LOADER, "Corrupted PARAM.SFO found! Assuming category GD. Try reinstalling the game.");
sys_log.fatal("Corrupted PARAM.SFO found! Assuming category GD. Try reinstalling the game.");
m_cat = "GD";
}
LOG_NOTICE(LOADER, "Title: %s", GetTitle());
LOG_NOTICE(LOADER, "Serial: %s", GetTitleID());
LOG_NOTICE(LOADER, "Category: %s", GetCat());
LOG_NOTICE(LOADER, "Version: %s / %s", version_app, version_disc);
sys_log.notice("Title: %s", GetTitle());
sys_log.notice("Serial: %s", GetTitleID());
sys_log.notice("Category: %s", GetCat());
sys_log.notice("Version: %s / %s", version_app, version_disc);
if (!force_global_config)
{
@ -1015,14 +1015,14 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
// Load custom config-1
if (fs::file cfg_file{ config_path_old })
{
LOG_NOTICE(LOADER, "Applying custom config: %s", config_path_old);
sys_log.notice("Applying custom config: %s", config_path_old);
g_cfg.from_string(cfg_file.to_string());
}
// Load custom config-2
if (fs::file cfg_file{ config_path_new })
{
LOG_NOTICE(LOADER, "Applying custom config: %s", config_path_new);
sys_log.notice("Applying custom config: %s", config_path_new);
g_cfg.from_string(cfg_file.to_string());
g_cfg.name = config_path_new;
}
@ -1030,7 +1030,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
// Load custom config-3
if (fs::file cfg_file{ m_path + ".yml" })
{
LOG_NOTICE(LOADER, "Applying custom config: %s.yml", m_path);
sys_log.notice("Applying custom config: %s.yml", m_path);
g_cfg.from_string(cfg_file.to_string());
}
}
@ -1038,11 +1038,11 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
#if defined(_WIN32) || defined(HAVE_VULKAN)
if (g_cfg.video.renderer == video_renderer::vulkan)
{
LOG_NOTICE(LOADER, "Vulkan SDK Revision: %d", VK_HEADER_VERSION);
sys_log.notice("Vulkan SDK Revision: %d", VK_HEADER_VERSION);
}
#endif
LOG_NOTICE(LOADER, "Used configuration:\n%s\n", g_cfg.to_string());
sys_log.notice("Used configuration:\n%s\n", g_cfg.to_string());
// Set RTM usage
g_use_rtm = utils::has_rtm() && ((utils::has_mpx() && g_cfg.core.enable_TSX == tsx_usage::enabled) || g_cfg.core.enable_TSX == tsx_usage::forced);
@ -1070,7 +1070,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (!hdd1.empty())
{
vfs::mount("/dev_hdd1", hdd1);
LOG_NOTICE(LOADER, "Hdd1: %s", vfs::get("/dev_hdd1"));
sys_log.notice("Hdd1: %s", vfs::get("/dev_hdd1"));
}
// Special boot mode (directory scan)
@ -1111,7 +1111,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
break;
}
LOG_NOTICE(LOADER, "Scanning directory: %s", dir_queue[i]);
sys_log.notice("Scanning directory: %s", dir_queue[i]);
for (auto&& entry : fs::dir(dir_queue[i]))
{
@ -1153,7 +1153,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
{
const auto& path = file_queue[i].first;
LOG_NOTICE(LOADER, "Trying to load SPRX: %s", path);
sys_log.notice("Trying to load SPRX: %s", path);
// Load MSELF or SPRX
fs::file src{path};
@ -1189,7 +1189,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
}
}
LOG_ERROR(LOADER, "Failed to load SPRX '%s' (%s)", path, obj.get_error());
sys_log.error("Failed to load SPRX '%s' (%s)", path, obj.get_error());
g_progr_fdone++;
}
@ -1217,17 +1217,17 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (bdvd_pos && from_hdd0_game)
{
// Booting disc game from wrong location
LOG_ERROR(LOADER, "Disc game %s found at invalid location /dev_hdd0/game/", m_title_id);
sys_log.error("Disc game %s found at invalid location /dev_hdd0/game/", m_title_id);
// Move and retry from correct location
if (fs::rename(elf_dir + "/../../", hdd0_disc + elf_dir.substr(hdd0_game.size()) + "/../../", false))
{
LOG_SUCCESS(LOADER, "Disc game %s moved to special location /dev_hdd0/disc/", m_title_id);
sys_log.success("Disc game %s moved to special location /dev_hdd0/disc/", m_title_id);
return m_path = hdd0_disc + m_path.substr(hdd0_game.size()), Load();
}
else
{
LOG_ERROR(LOADER, "Failed to move disc game %s to /dev_hdd0/disc/ (%s)", m_title_id, fs::g_tls_error);
sys_log.error("Failed to move disc game %s to /dev_hdd0/disc/ (%s)", m_title_id, fs::g_tls_error);
return;
}
}
@ -1254,7 +1254,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
}
else
{
LOG_FATAL(LOADER, "Disc directory not found. Try to run the game from the actual game disc directory.");
sys_log.fatal("Disc directory not found. Try to run the game from the actual game disc directory.");
}
}
@ -1264,14 +1264,14 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
fs::file sfb_file;
vfs::mount("/dev_bdvd", bdvd_dir);
LOG_NOTICE(LOADER, "Disc: %s", vfs::get("/dev_bdvd"));
sys_log.notice("Disc: %s", vfs::get("/dev_bdvd"));
vfs::mount("/dev_bdvd/PS3_GAME", bdvd_dir + m_game_dir + "/");
LOG_NOTICE(LOADER, "Game: %s", vfs::get("/dev_bdvd/PS3_GAME"));
sys_log.notice("Game: %s", vfs::get("/dev_bdvd/PS3_GAME"));
if (!sfb_file.open(vfs::get("/dev_bdvd/PS3_DISC.SFB")) || sfb_file.size() < 4 || sfb_file.read<u32>() != ".SFB"_u32)
{
LOG_ERROR(LOADER, "Invalid disc directory for the disc game %s", m_title_id);
sys_log.error("Invalid disc directory for the disc game %s", m_title_id);
return;
}
@ -1279,7 +1279,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (bdvd_title_id != m_title_id)
{
LOG_ERROR(LOADER, "Unexpected disc directory for the disc game %s (found %s)", m_title_id, bdvd_title_id);
sys_log.error("Unexpected disc directory for the disc game %s (found %s)", m_title_id, bdvd_title_id);
return;
}
@ -1292,11 +1292,11 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
else if (m_cat == "1P" && from_hdd0_game)
{
//PS1 Classics
LOG_NOTICE(LOADER, "PS1 Game: %s, %s", m_title_id, m_title);
sys_log.notice("PS1 Game: %s, %s", m_title_id, m_title);
std::string gamePath = m_path.substr(m_path.find("/dev_hdd0/game/"), 24);
LOG_NOTICE(LOADER, "Forcing manual lib loading mode");
sys_log.notice("Forcing manual lib loading mode");
g_cfg.core.lib_loading.from_string(fmt::format("%s", lib_loading_type::manual));
g_cfg.core.load_libraries.from_list({});
@ -1326,23 +1326,23 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
else if (m_cat == "DG" && from_hdd0_game)
{
vfs::mount("/dev_bdvd/PS3_GAME", hdd0_game + m_path.substr(hdd0_game.size(), 10));
LOG_NOTICE(LOADER, "Game: %s", vfs::get("/dev_bdvd/PS3_GAME"));
sys_log.notice("Game: %s", vfs::get("/dev_bdvd/PS3_GAME"));
}
else if (disc.empty())
{
LOG_ERROR(LOADER, "Failed to mount disc directory for the disc game %s", m_title_id);
sys_log.error("Failed to mount disc directory for the disc game %s", m_title_id);
return;
}
else
{
bdvd_dir = disc;
vfs::mount("/dev_bdvd", bdvd_dir);
LOG_NOTICE(LOADER, "Disk: %s", vfs::get("/dev_bdvd"));
sys_log.notice("Disk: %s", vfs::get("/dev_bdvd"));
}
if (add_only)
{
LOG_NOTICE(LOADER, "Finished to add data to games.yml by boot for: %s", m_path);
sys_log.notice("Finished to add data to games.yml by boot for: %s", m_path);
m_path = m_path_old; // Reset m_path to fix boot from gui
return;
}
@ -1363,14 +1363,14 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (lock_file && fs::is_dir(ins_dir))
{
LOG_NOTICE(LOADER, "Found INSDIR: %s", ins_dir);
sys_log.notice("Found INSDIR: %s", ins_dir);
for (auto&& entry : fs::dir{ins_dir})
{
const std::string pkg = ins_dir + entry.name;
if (!entry.is_directory && ends_with(entry.name, ".PKG") && !InstallPkg(pkg))
{
LOG_ERROR(LOADER, "Failed to install %s", pkg);
sys_log.error("Failed to install %s", pkg);
return;
}
}
@ -1378,7 +1378,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (lock_file && fs::is_dir(pkg_dir))
{
LOG_NOTICE(LOADER, "Found PKGDIR: %s", pkg_dir);
sys_log.notice("Found PKGDIR: %s", pkg_dir);
for (auto&& entry : fs::dir{pkg_dir})
{
@ -1388,7 +1388,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (fs::is_file(pkg_file) && !InstallPkg(pkg_file))
{
LOG_ERROR(LOADER, "Failed to install %s", pkg_file);
sys_log.error("Failed to install %s", pkg_file);
return;
}
}
@ -1397,7 +1397,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (lock_file && fs::is_dir(extra_dir))
{
LOG_NOTICE(LOADER, "Found PS3_EXTRA: %s", extra_dir);
sys_log.notice("Found PS3_EXTRA: %s", extra_dir);
for (auto&& entry : fs::dir{extra_dir})
{
@ -1407,7 +1407,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (fs::is_file(pkg_file) && !InstallPkg(pkg_file))
{
LOG_ERROR(LOADER, "Failed to install %s", pkg_file);
sys_log.error("Failed to install %s", pkg_file);
return;
}
}
@ -1421,7 +1421,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (disc.empty() && m_cat == "DG" && fs::is_file(hdd0_boot))
{
// Booting game update
LOG_SUCCESS(LOADER, "Updates found at /dev_hdd0/game/%s/!", m_title_id);
sys_log.success("Updates found at /dev_hdd0/game/%s/!", m_title_id);
return m_path = hdd0_boot, Load();
}
@ -1434,7 +1434,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (!bdvd_title.empty() && bdvd_title != m_title)
{
LOG_NOTICE(LOADER, "Title was set from %s to %s", m_title, bdvd_title);
sys_log.notice("Title was set from %s to %s", m_title, bdvd_title);
m_title = bdvd_title;
}
}
@ -1465,7 +1465,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (!elf_file)
{
LOG_ERROR(LOADER, "Failed to open executable: %s", elf_path);
sys_log.error("Failed to open executable: %s", elf_path);
return;
}
@ -1496,7 +1496,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
}
else
{
LOG_ERROR(LOADER, "Failed to create boot.elf");
sys_log.error("Failed to create boot.elf");
}
}
}
@ -1507,7 +1507,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
if (!elf_file)
{
LOG_ERROR(LOADER, "Failed to decrypt SELF: %s", elf_path);
sys_log.error("Failed to decrypt SELF: %s", elf_path);
return;
}
@ -1534,13 +1534,13 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
{
argv[0] = "/dev_bdvd/PS3_GAME/" + m_path.substr(hdd0_game.size() + 10);
m_dir = "/dev_hdd0/game/" + m_path.substr(hdd0_game.size(), 10);
LOG_NOTICE(LOADER, "Disc path: %s", m_dir);
sys_log.notice("Disc path: %s", m_dir);
}
else if (from_hdd0_game)
{
argv[0] = "/dev_hdd0/game/" + m_path.substr(hdd0_game.size());
m_dir = "/dev_hdd0/game/" + m_path.substr(hdd0_game.size(), 10);
LOG_NOTICE(LOADER, "Boot path: %s", m_dir);
sys_log.notice("Boot path: %s", m_dir);
}
else if (!bdvd_dir.empty() && fs::is_dir(bdvd_dir))
{
@ -1556,7 +1556,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
m_dir = "/host_root/" + elf_dir + '/';
}
LOG_NOTICE(LOADER, "Elf path: %s", argv[0]);
sys_log.notice("Elf path: %s", argv[0]);
}
const auto _main = g_fxo->init<ppu_module>();
@ -1580,7 +1580,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
}
else
{
LOG_NOTICE(LOADER, "Cache: %s", _main->cache);
sys_log.notice("Cache: %s", _main->cache);
}
g_fxo->init();
@ -1609,11 +1609,11 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
}
else
{
LOG_ERROR(LOADER, "Invalid or unsupported file format: %s", elf_path);
sys_log.error("Invalid or unsupported file format: %s", elf_path);
LOG_WARNING(LOADER, "** ppu_exec -> %s", ppu_exec.get_error());
LOG_WARNING(LOADER, "** ppu_prx -> %s", ppu_prx.get_error());
LOG_WARNING(LOADER, "** spu_exec -> %s", spu_exec.get_error());
sys_log.warning("** ppu_exec -> %s", ppu_exec.get_error());
sys_log.warning("** ppu_prx -> %s", ppu_prx.get_error());
sys_log.warning("** spu_exec -> %s", spu_exec.get_error());
return;
}
@ -1630,7 +1630,7 @@ void Emulator::Load(const std::string& title_id, bool add_only, bool force_globa
}
catch (const std::exception& e)
{
LOG_FATAL(LOADER, "%s thrown: %s", typeid(e).name(), e.what());
sys_log.fatal("%s thrown: %s", typeid(e).name(), e.what());
Stop();
}
}