diff options
Diffstat (limited to 'src/common/logging')
-rw-r--r-- | src/common/logging/backend.cpp | 2 | ||||
-rw-r--r-- | src/common/logging/backend.h | 2 | ||||
-rw-r--r-- | src/common/logging/filter.cpp | 5 | ||||
-rw-r--r-- | src/common/logging/filter.h | 4 | ||||
-rw-r--r-- | src/common/logging/log.h | 10 | ||||
-rw-r--r-- | src/common/logging/text_formatter.h | 2 |
6 files changed, 13 insertions, 12 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 1323f8d0f..efd776db6 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -135,7 +135,7 @@ FileBackend::FileBackend(const std::string& filename) void FileBackend::Write(const Entry& entry) { // prevent logs from going over the maximum size (in case its spamming and the user doesn't // know) - constexpr size_t MAX_BYTES_WRITTEN = 50 * 1024L * 1024L; + constexpr std::size_t MAX_BYTES_WRITTEN = 50 * 1024L * 1024L; if (!file.IsOpen() || bytes_written > MAX_BYTES_WRITTEN) { return; } diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h index b3f4b9cef..11edbf1b6 100644 --- a/src/common/logging/backend.h +++ b/src/common/logging/backend.h @@ -100,7 +100,7 @@ public: private: FileUtil::IOFile file; - size_t bytes_written; + std::size_t bytes_written; }; void AddBackend(std::unique_ptr<Backend> backend); diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 2dd331152..2eccbcd8d 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -71,7 +71,7 @@ void Filter::ResetAll(Level level) { } void Filter::SetClassLevel(Class log_class, Level level) { - class_levels[static_cast<size_t>(log_class)] = level; + class_levels[static_cast<std::size_t>(log_class)] = level; } void Filter::ParseFilterString(std::string_view filter_view) { @@ -93,7 +93,8 @@ void Filter::ParseFilterString(std::string_view filter_view) { } bool Filter::CheckMessage(Class log_class, Level level) const { - return static_cast<u8>(level) >= static_cast<u8>(class_levels[static_cast<size_t>(log_class)]); + return static_cast<u8>(level) >= + static_cast<u8>(class_levels[static_cast<std::size_t>(log_class)]); } bool Filter::IsDebug() const { diff --git a/src/common/logging/filter.h b/src/common/logging/filter.h index d5ffc5a58..773df6f2c 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); @@ -49,6 +49,6 @@ public: bool IsDebug() const; private: - std::array<Level, (size_t)Class::Count> class_levels; + std::array<Level, static_cast<std::size_t>(Class::Count)> class_levels; }; } // namespace Log diff --git a/src/common/logging/log.h b/src/common/logging/log.h index e12f47f8f..4d577524f 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,7 +49,7 @@ enum class Class : ClassType { Kernel, ///< The HLE implementation of the CTR kernel Kernel_SVC, ///< Kernel system calls Service, ///< HLE implementation of system services. Each major service - /// should have its own subclass. + ///< should have its own subclass. Service_ACC, ///< The ACC (Accounts) service Service_AM, ///< The AM (Applet manager) service Service_AOC, ///< The AOC (AddOn Content) service 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 |