mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	common: Address feedback
This commit is contained in:
		
							parent
							
								
									9527bfffed
								
							
						
					
					
						commit
						d7b4260389
					
				
					 8 changed files with 29 additions and 16 deletions
				
			
		|  | @ -202,7 +202,7 @@ public: | |||
|         return *instance; | ||||
|     } | ||||
| 
 | ||||
|     static void Initialize() { | ||||
|     static void Initialize(std::string_view log_file) { | ||||
|         if (instance) { | ||||
|             LOG_WARNING(Log, "Reinitializing logging backend"); | ||||
|             return; | ||||
|  | @ -212,8 +212,8 @@ public: | |||
|         void(FileUtil::CreateDir(log_dir)); | ||||
|         Filter filter; | ||||
|         filter.ParseFilterString(Settings::values.log_filter.GetValue()); | ||||
|         instance = std::unique_ptr<Impl, decltype(&Deleter)>(new Impl(log_dir + LOG_FILE, filter), | ||||
|                                                              Deleter); | ||||
|         instance = std::unique_ptr<Impl, decltype(&Deleter)>( | ||||
|             new Impl(fmt::format("{}{}", log_dir, log_file), filter), Deleter); | ||||
|         initialization_in_progress_suppress_logging = false; | ||||
|     } | ||||
| 
 | ||||
|  | @ -414,8 +414,8 @@ private: | |||
| }; | ||||
| } // namespace
 | ||||
| 
 | ||||
| void Initialize() { | ||||
|     Impl::Initialize(); | ||||
| void Initialize(std::string_view log_file) { | ||||
|     Impl::Initialize(log_file.empty() ? LOG_FILE : log_file); | ||||
| } | ||||
| 
 | ||||
| void Start() { | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ | |||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #include <string_view> | ||||
| #include "common/logging/filter.h" | ||||
| 
 | ||||
| namespace Common::Log { | ||||
|  | @ -11,7 +12,7 @@ namespace Common::Log { | |||
| class Filter; | ||||
| 
 | ||||
| /// Initializes the logging system. This should be the first thing called in main.
 | ||||
| void Initialize(); | ||||
| void Initialize(std::string_view log_file = ""); | ||||
| 
 | ||||
| void Start(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ struct Entry { | |||
|     Class log_class{}; | ||||
|     Level log_level{}; | ||||
|     const char* filename = nullptr; | ||||
|     unsigned int line_num = 0; | ||||
|     u32 line_num = 0; | ||||
|     std::string function; | ||||
|     std::string message; | ||||
| }; | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ enum class Level : u8 { | |||
|     Critical, ///< Major problems during execution that threaten the stability of the entire
 | ||||
|     ///< application.
 | ||||
| 
 | ||||
|     Count ///< Total number of logging levels
 | ||||
|     Count, ///< Total number of logging levels
 | ||||
| }; | ||||
| 
 | ||||
| /**
 | ||||
|  | @ -100,7 +100,7 @@ enum class Class : u8 { | |||
|     Movie,           ///< Movie (Input Recording) Playback
 | ||||
|     WebService,      ///< Interface to Citra Web Services
 | ||||
|     RPC_Server,      ///< RPC server
 | ||||
|     Count            ///< Total number of logging classes
 | ||||
|     Count,           ///< Total number of logging classes
 | ||||
| }; | ||||
| 
 | ||||
| } // namespace Common::Log
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue