Convert old logging calls to new logging macros

This commit is contained in:
Yuri Kunde Schlesner 2014-12-05 23:53:49 -02:00
parent 6390c66e95
commit 0600e2d8b5
65 changed files with 502 additions and 516 deletions

View file

@ -27,7 +27,7 @@ int __cdecl main(int argc, char **argv) {
});
if (argc < 2) {
ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified");
LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified");
return -1;
}
@ -40,7 +40,7 @@ int __cdecl main(int argc, char **argv) {
Loader::ResultStatus load_result = Loader::LoadFile(boot_filename);
if (Loader::ResultStatus::Success != load_result) {
ERROR_LOG(BOOT, "Failed to load ROM (Error %i)!", load_result);
LOG_CRITICAL(Frontend, "Failed to load ROM (Error %i)!", load_result);
return -1;
}

View file

@ -22,17 +22,17 @@ Config::Config() {
bool Config::LoadINI(INIReader* config, const char* location, const std::string& default_contents, bool retry) {
if (config->ParseError() < 0) {
if (retry) {
ERROR_LOG(CONFIG, "Failed to load %s. Creating file from defaults...", location);
LOG_WARNING(Config, "Failed to load %s. Creating file from defaults...", location);
FileUtil::CreateFullPath(location);
FileUtil::WriteStringToFile(true, default_contents, location);
*config = INIReader(location); // Reopen file
return LoadINI(config, location, default_contents, false);
}
ERROR_LOG(CONFIG, "Failed.");
LOG_ERROR(Config, "Failed.");
return false;
}
INFO_LOG(CONFIG, "Successfully loaded %s", location);
LOG_INFO(Config, "Successfully loaded %s", location);
return true;
}

View file

@ -36,15 +36,15 @@ const bool EmuWindow_GLFW::IsOpen() {
}
void EmuWindow_GLFW::OnFramebufferResizeEvent(GLFWwindow* win, int width, int height) {
_dbg_assert_(GUI, width > 0);
_dbg_assert_(GUI, height > 0);
_dbg_assert_(Frontend, width > 0);
_dbg_assert_(Frontend, height > 0);
GetEmuWindow(win)->NotifyFramebufferSizeChanged(std::pair<unsigned,unsigned>(width, height));
}
void EmuWindow_GLFW::OnClientAreaResizeEvent(GLFWwindow* win, int width, int height) {
_dbg_assert_(GUI, width > 0);
_dbg_assert_(GUI, height > 0);
_dbg_assert_(Frontend, width > 0);
_dbg_assert_(Frontend, height > 0);
// NOTE: GLFW provides no proper way to set a minimal window size.
// Hence, we just ignore the corresponding EmuWindow hint.
@ -59,12 +59,12 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
ReloadSetKeymaps();
glfwSetErrorCallback([](int error, const char *desc){
ERROR_LOG(GUI, "GLFW 0x%08x: %s", error, desc);
LOG_ERROR(Frontend, "GLFW 0x%08x: %s", error, desc);
});
// Initialize the window
if(glfwInit() != GL_TRUE) {
ERROR_LOG(GUI, "Failed to initialize GLFW! Exiting...");
LOG_CRITICAL(Frontend, "Failed to initialize GLFW! Exiting...");
exit(1);
}
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
@ -79,7 +79,7 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
window_title.c_str(), nullptr, nullptr);
if (m_render_window == nullptr) {
ERROR_LOG(GUI, "Failed to create GLFW window! Exiting...");
LOG_CRITICAL(Frontend, "Failed to create GLFW window! Exiting...");
exit(1);
}
@ -149,7 +149,7 @@ void EmuWindow_GLFW::OnMinimalClientAreaChangeRequest(const std::pair<unsigned,u
std::pair<int,int> current_size;
glfwGetWindowSize(m_render_window, &current_size.first, &current_size.second);
_dbg_assert_(GUI, (int)minimal_size.first > 0 && (int)minimal_size.second > 0);
_dbg_assert_(Frontend, (int)minimal_size.first > 0 && (int)minimal_size.second > 0);
int new_width = std::max(current_size.first, (int)minimal_size.first);
int new_height = std::max(current_size.second, (int)minimal_size.second);