diff options
Diffstat (limited to 'src/common/logging')
| -rw-r--r-- | src/common/logging/backend.cpp | 19 | ||||
| -rw-r--r-- | src/common/logging/filter.cpp | 4 | ||||
| -rw-r--r-- | src/common/logging/types.h | 4 | 
3 files changed, 19 insertions, 8 deletions
| diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index b6fa4affb..61dddab3f 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -171,19 +171,22 @@ FileBackend::FileBackend(const std::filesystem::path& filename) {  FileBackend::~FileBackend() = default;  void FileBackend::Write(const Entry& entry) { +    if (!file->IsOpen()) { +        return; +    } +      using namespace Common::Literals; -    // prevent logs from going over the maximum size (in case its spamming and the user doesn't -    // know) +    // Prevent logs from exceeding a set maximum size in the event that log entries are spammed.      constexpr std::size_t MAX_BYTES_WRITTEN = 100_MiB;      constexpr std::size_t MAX_BYTES_WRITTEN_EXTENDED = 1_GiB; -    if (!file->IsOpen()) { -        return; -    } +    const bool write_limit_exceeded = +        bytes_written > MAX_BYTES_WRITTEN_EXTENDED || +        (bytes_written > MAX_BYTES_WRITTEN && !Settings::values.extended_logging); -    if (Settings::values.extended_logging && bytes_written > MAX_BYTES_WRITTEN_EXTENDED) { -        return; -    } else if (!Settings::values.extended_logging && bytes_written > MAX_BYTES_WRITTEN) { +    // Close the file after the write limit is exceeded. +    if (write_limit_exceeded) { +        file->Close();          return;      } diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 4f2cc29e1..f055f0e11 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -144,6 +144,10 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {      SUB(Render, Software)                                                                          \      SUB(Render, OpenGL)                                                                            \      SUB(Render, Vulkan)                                                                            \ +    CLS(Shader)                                                                                    \ +    SUB(Shader, SPIRV)                                                                             \ +    SUB(Shader, GLASM)                                                                             \ +    SUB(Shader, GLSL)                                                                              \      CLS(Audio)                                                                                     \      SUB(Audio, DSP)                                                                                \      SUB(Audio, Sink)                                                                               \ diff --git a/src/common/logging/types.h b/src/common/logging/types.h index 88b0e9c01..7ad0334fc 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h @@ -114,6 +114,10 @@ enum class Class : u8 {      Render_Software,   ///< Software renderer backend      Render_OpenGL,     ///< OpenGL backend      Render_Vulkan,     ///< Vulkan backend +    Shader,            ///< Shader recompiler +    Shader_SPIRV,      ///< Shader SPIR-V code generation +    Shader_GLASM,      ///< Shader GLASM code generation +    Shader_GLSL,       ///< Shader GLSL code generation      Audio,             ///< Audio emulation      Audio_DSP,         ///< The HLE implementation of the DSP      Audio_Sink,        ///< Emulator audio output backend | 
