From 787fff9a64c888c021f282887b57be79bf8f18dc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 4 Sep 2018 10:43:29 -0400 Subject: [PATCH 1/3] common/logging/filter: Make constructor explicit Implicit conversions aren't desirable here. --- src/common/logging/filter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/logging/filter.h b/src/common/logging/filter.h index e887c32a1..ccb021050 100644 --- a/src/common/logging/filter.h +++ b/src/common/logging/filter.h @@ -19,7 +19,7 @@ namespace Log { class Filter { public: /// 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. void ResetAll(Level level); From 83c32b8d224c974b9a8b0e846ab5942bad719d53 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 4 Sep 2018 10:44:36 -0400 Subject: [PATCH 2/3] common/logging/filter: Replace C-style case with C++ static_cast --- src/common/logging/filter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/logging/filter.h b/src/common/logging/filter.h index ccb021050..bbadbcba1 100644 --- a/src/common/logging/filter.h +++ b/src/common/logging/filter.h @@ -46,6 +46,6 @@ public: bool CheckMessage(Class log_class, Level level) const; private: - std::array class_levels; + std::array(Class::Count)> class_levels; }; } // namespace Log From 1cf3ef15b929599f484eee6af18d8cc6776a830e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 4 Sep 2018 10:49:06 -0400 Subject: [PATCH 3/3] common/logging: Amend documentation comments Multi-line doc comments still need the '<' after the ///, otherwise it's treated as a regular comment and makes the original doc comment broken in viewers, IDEs, etc. While we're at it, also fix some typos in the comments. --- src/common/logging/log.h | 12 ++++++------ src/common/logging/text_formatter.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/logging/log.h b/src/common/logging/log.h index f8f70216f..59f3fae7d 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -12,14 +12,14 @@ namespace Log { /// Specifies the severity or level of detail of the log message. enum class Level : u8 { Trace, ///< Extremely detailed and repetitive debugging information that is likely to - /// pollute logs. + ///< pollute logs. Debug, ///< Less detailed debugging information. Info, ///< Status information from important points during execution. 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 - /// completed. - Critical, ///< Major problems during execution that threathen the stability of the entire - /// application. + ///< completed. + Critical, ///< Major problems during execution that threaten the stability of the entire + ///< application. Count ///< Total number of logging levels }; @@ -49,10 +49,10 @@ enum class Class : ClassType { Kernel, ///< The HLE implementation of the CTR kernel Kernel_SVC, ///< Kernel system calls Applet, ///< HLE implementation of system applets. Each applet - /// should have its own subclass. + ///< should have its own subclass. Applet_SWKBD, ///< The Software Keyboard applet 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_FRD, ///< The FRD (Friends) service Service_FS, ///< The FS (Filesystem) service implementation diff --git a/src/common/logging/text_formatter.h b/src/common/logging/text_formatter.h index 9609cec7c..b6d9e57c8 100644 --- a/src/common/logging/text_formatter.h +++ b/src/common/logging/text_formatter.h @@ -15,6 +15,6 @@ struct Entry; std::string FormatLogMessage(const Entry& entry); /// Formats and prints a log entry to stderr. 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); } // namespace Log