Merge pull request #6638 from GPUCode/new-log
common: Backport yuzu log improvements
This commit is contained in:
		| @@ -7,8 +7,8 @@ | ||||
| #include <sstream> | ||||
| #include <unordered_map> | ||||
| #include <inih/cpp/INIReader.h> | ||||
|  | ||||
| #include "common/file_util.h" | ||||
| #include "common/logging/backend.h" | ||||
| #include "common/logging/log.h" | ||||
| #include "common/param_package.h" | ||||
| #include "common/settings.h" | ||||
| @@ -260,6 +260,12 @@ void Config::ReadValues() { | ||||
|     // Miscellaneous | ||||
|     ReadSetting("Miscellaneous", Settings::values.log_filter); | ||||
|  | ||||
|     // Apply the log_filter setting as the logger has already been initialized | ||||
|     // and doesn't pick up the filter on its own. | ||||
|     Common::Log::Filter filter; | ||||
|     filter.ParseFilterString(Settings::values.log_filter.GetValue()); | ||||
|     Common::Log::SetGlobalFilter(filter); | ||||
|  | ||||
|     // Debugging | ||||
|     Settings::values.record_frame_times = | ||||
|         sdl2_config->GetBoolean("Debugging", "record_frame_times", false); | ||||
|   | ||||
| @@ -180,12 +180,6 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) { | ||||
|     if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION) != JNI_OK) | ||||
|         return JNI_ERR; | ||||
|  | ||||
|     // Initialize Logger | ||||
|     Log::Filter log_filter; | ||||
|     log_filter.ParseFilterString(Settings::values.log_filter.GetValue()); | ||||
|     Log::SetGlobalFilter(log_filter); | ||||
|     Log::AddBackend(std::make_unique<Log::LogcatBackend>()); | ||||
|  | ||||
|     // Initialize misc classes | ||||
|     s_savestate_info_class = reinterpret_cast<jclass>( | ||||
|         env->NewGlobalRef(env->FindClass("org/citra/citra_emu/NativeLibrary$SavestateInfo"))); | ||||
|   | ||||
| @@ -141,7 +141,7 @@ static Core::System::ResultStatus RunCitra(const std::string& filepath) { | ||||
|         app_loader->ReadProgramId(program_id); | ||||
|         GameSettings::LoadOverrides(program_id); | ||||
|     } | ||||
|     Settings::Apply(); | ||||
|     system.ApplySettings(); | ||||
|     Settings::LogSettings(); | ||||
|  | ||||
|     Camera::RegisterFactory("image", std::make_unique<Camera::StillImage::Factory>()); | ||||
| @@ -438,10 +438,8 @@ void Java_org_citra_citra_1emu_NativeLibrary_CreateConfigFile(JNIEnv* env, | ||||
|  | ||||
| void Java_org_citra_citra_1emu_NativeLibrary_CreateLogFile(JNIEnv* env, | ||||
|                                                            [[maybe_unused]] jclass clazz) { | ||||
|     Log::RemoveBackend(Log::FileBackend::Name()); | ||||
|     FileUtil::CreateFullPath(FileUtil::GetUserPath(FileUtil::UserPath::LogDir)); | ||||
|     Log::AddBackend(std::make_unique<Log::FileBackend>( | ||||
|         FileUtil::GetUserPath(FileUtil::UserPath::LogDir) + LOG_FILE)); | ||||
|     Common::Log::Initialize(); | ||||
|     Common::Log::Start(); | ||||
|     LOG_INFO(Frontend, "Logging backend initialised"); | ||||
| } | ||||
|  | ||||
| @@ -474,7 +472,7 @@ void Java_org_citra_citra_1emu_NativeLibrary_ReloadSettings(JNIEnv* env, | ||||
|         GameSettings::LoadOverrides(program_id); | ||||
|     } | ||||
|  | ||||
|     Settings::Apply(); | ||||
|     system.ApplySettings(); | ||||
| } | ||||
|  | ||||
| jstring Java_org_citra_citra_1emu_NativeLibrary_GetUserSetting(JNIEnv* env, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 GPUCode
					GPUCode