Merge pull request #4221 from FearlessTobi/port-1238

Port #1238 from yuzu: "common/logging: Minor changes"
This commit is contained in:
Weiyi Wang 2018-09-21 12:32:53 -04:00 committed by GitHub
commit 59982c5479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -19,7 +19,7 @@ namespace Log {
class Filter { class Filter {
public: public:
/// Initializes the filter with all classes having `default_level` as the minimum level. /// Initializes the filter with all classes having `default_level` as the minimum level.
Filter(Level default_level = Level::Info); explicit Filter(Level default_level = Level::Info);
/// Resets the filter so that all classes have `level` as the minimum displayed level. /// Resets the filter so that all classes have `level` as the minimum displayed level.
void ResetAll(Level level); void ResetAll(Level level);
@ -46,6 +46,6 @@ public:
bool CheckMessage(Class log_class, Level level) const; bool CheckMessage(Class log_class, Level level) const;
private: private:
std::array<Level, (std::size_t)Class::Count> class_levels; std::array<Level, static_cast<std::size_t>(Class::Count)> class_levels;
}; };
} // namespace Log } // namespace Log

View File

@ -12,14 +12,14 @@ namespace Log {
/// Specifies the severity or level of detail of the log message. /// Specifies the severity or level of detail of the log message.
enum class Level : u8 { enum class Level : u8 {
Trace, ///< Extremely detailed and repetitive debugging information that is likely to Trace, ///< Extremely detailed and repetitive debugging information that is likely to
/// pollute logs. ///< pollute logs.
Debug, ///< Less detailed debugging information. Debug, ///< Less detailed debugging information.
Info, ///< Status information from important points during execution. Info, ///< Status information from important points during execution.
Warning, ///< Minor or potential problems found during execution of a task. Warning, ///< Minor or potential problems found during execution of a task.
Error, ///< Major problems found during execution of a task that prevent it from being Error, ///< Major problems found during execution of a task that prevent it from being
/// completed. ///< completed.
Critical, ///< Major problems during execution that threathen the stability of the entire Critical, ///< Major problems during execution that threaten the stability of the entire
/// application. ///< application.
Count ///< Total number of logging levels Count ///< Total number of logging levels
}; };
@ -49,10 +49,10 @@ enum class Class : ClassType {
Kernel, ///< The HLE implementation of the CTR kernel Kernel, ///< The HLE implementation of the CTR kernel
Kernel_SVC, ///< Kernel system calls Kernel_SVC, ///< Kernel system calls
Applet, ///< HLE implementation of system applets. Each applet Applet, ///< HLE implementation of system applets. Each applet
/// should have its own subclass. ///< should have its own subclass.
Applet_SWKBD, ///< The Software Keyboard applet Applet_SWKBD, ///< The Software Keyboard applet
Service, ///< HLE implementation of system services. Each major service Service, ///< HLE implementation of system services. Each major service
/// should have its own subclass. ///< should have its own subclass.
Service_SRV, ///< The SRV (Service Directory) implementation Service_SRV, ///< The SRV (Service Directory) implementation
Service_FRD, ///< The FRD (Friends) service Service_FRD, ///< The FRD (Friends) service
Service_FS, ///< The FS (Filesystem) service implementation Service_FS, ///< The FS (Filesystem) service implementation

View File

@ -15,6 +15,6 @@ struct Entry;
std::string FormatLogMessage(const Entry& entry); std::string FormatLogMessage(const Entry& entry);
/// Formats and prints a log entry to stderr. /// Formats and prints a log entry to stderr.
void PrintMessage(const Entry& entry); void PrintMessage(const Entry& entry);
/// Prints the same message as `PrintMessage`, but colored acoording to the severity level. /// Prints the same message as `PrintMessage`, but colored according to the severity level.
void PrintColoredMessage(const Entry& entry); void PrintColoredMessage(const Entry& entry);
} // namespace Log } // namespace Log