summaryrefslogtreecommitdiffstats
path: root/src/common/logging
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-06-25 04:09:12 +0200
committerGitHub <noreply@github.com>2021-06-25 04:09:12 +0200
commitb9c2732121e2594a64d1141807c7d5bd0f317d0f (patch)
tree700ab748e15d1e7d5cf7f58f2cbac133b7a84915 /src/common/logging
parentMerge pull request #6522 from Morph1984/pragma (diff)
parentcommon: Replace common_sizes into user-literals (diff)
downloadyuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar
yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.gz
yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.bz2
yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.lz
yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.xz
yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.zst
yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.zip
Diffstat (limited to 'src/common/logging')
-rw-r--r--src/common/logging/backend.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 47ce06478..b6fa4affb 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -19,6 +19,8 @@
#include "common/assert.h"
#include "common/fs/file.h"
#include "common/fs/fs.h"
+#include "common/literals.h"
+
#include "common/logging/backend.h"
#include "common/logging/log.h"
#include "common/logging/text_formatter.h"
@@ -98,8 +100,8 @@ private:
write_logs(entry);
}
- // Drain the logging queue. Only writes out up to MAX_LOGS_TO_WRITE to prevent a case
- // where a system is repeatedly spamming logs even on close.
+ // Drain the logging queue. Only writes out up to MAX_LOGS_TO_WRITE to prevent a
+ // case where a system is repeatedly spamming logs even on close.
const int MAX_LOGS_TO_WRITE = filter.IsDebug() ? INT_MAX : 100;
int logs_written = 0;
while (logs_written++ < MAX_LOGS_TO_WRITE && message_queue.Pop(entry)) {
@@ -169,10 +171,11 @@ FileBackend::FileBackend(const std::filesystem::path& filename) {
FileBackend::~FileBackend() = default;
void FileBackend::Write(const Entry& entry) {
+ using namespace Common::Literals;
// prevent logs from going over the maximum size (in case its spamming and the user doesn't
// know)
- constexpr std::size_t MAX_BYTES_WRITTEN = 100 * 1024 * 1024;
- constexpr std::size_t MAX_BYTES_WRITTEN_EXTENDED = 1024 * 1024 * 1024;
+ constexpr std::size_t MAX_BYTES_WRITTEN = 100_MiB;
+ constexpr std::size_t MAX_BYTES_WRITTEN_EXTENDED = 1_GiB;
if (!file->IsOpen()) {
return;