diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-09-30 22:11:47 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-10-02 02:48:49 +0200 |
commit | 5daf3abe65bb168e4274049c26e7f309b8f10e82 (patch) | |
tree | f62a59154b2ab0460e83f1bbfb02f93a3364ec3f /src/common/logging | |
parent | Merge pull request #7061 from ameerj/dma-buffer-misc (diff) | |
download | yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.tar yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.tar.gz yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.tar.bz2 yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.tar.lz yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.tar.xz yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.tar.zst yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.zip |
Diffstat (limited to 'src/common/logging')
-rw-r--r-- | src/common/logging/backend.cpp | 3 | ||||
-rw-r--r-- | src/common/logging/log.h | 4 | ||||
-rw-r--r-- | src/common/logging/log_entry.h | 28 | ||||
-rw-r--r-- | src/common/logging/text_formatter.cpp | 1 | ||||
-rw-r--r-- | src/common/logging/types.h | 17 |
5 files changed, 36 insertions, 17 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index e40d117d6..0e85a9c1d 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -9,6 +9,8 @@ #include <thread> #include <vector> +#include <fmt/format.h> + #ifdef _WIN32 #include <windows.h> // For OutputDebugStringW #endif @@ -22,6 +24,7 @@ #include "common/logging/backend.h" #include "common/logging/log.h" +#include "common/logging/log_entry.h" #include "common/logging/text_formatter.h" #include "common/settings.h" #ifdef _WIN32 diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 8d43eddc7..34fd2c30b 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -4,7 +4,11 @@ #pragma once +#include <algorithm> +#include <string_view> + #include <fmt/format.h> + #include "common/logging/types.h" namespace Common::Log { diff --git a/src/common/logging/log_entry.h b/src/common/logging/log_entry.h new file mode 100644 index 000000000..dd6f44841 --- /dev/null +++ b/src/common/logging/log_entry.h @@ -0,0 +1,28 @@ +// Copyright 2021 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <chrono> + +#include "common/logging/types.h" + +namespace Common::Log { + +/** + * A log entry. Log entries are store in a structured format to permit more varied output + * formatting on different frontends, as well as facilitating filtering and aggregation. + */ +struct Entry { + std::chrono::microseconds timestamp; + Class log_class{}; + Level log_level{}; + const char* filename = nullptr; + unsigned int line_num = 0; + std::string function; + std::string message; + bool final_entry = false; +}; + +} // namespace Common::Log diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index cfc0d5846..10b2281db 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp @@ -13,6 +13,7 @@ #include "common/common_funcs.h" #include "common/logging/filter.h" #include "common/logging/log.h" +#include "common/logging/log_entry.h" #include "common/logging/text_formatter.h" #include "common/string_util.h" diff --git a/src/common/logging/types.h b/src/common/logging/types.h index ddf9d27ca..2d21fc483 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h @@ -4,8 +4,6 @@ #pragma once -#include <chrono> - #include "common/common_types.h" namespace Common::Log { @@ -131,19 +129,4 @@ enum class Class : u8 { Count ///< Total number of logging classes }; -/** - * A log entry. Log entries are store in a structured format to permit more varied output - * formatting on different frontends, as well as facilitating filtering and aggregation. - */ -struct Entry { - std::chrono::microseconds timestamp; - Class log_class{}; - Level log_level{}; - const char* filename = nullptr; - unsigned int line_num = 0; - std::string function; - std::string message; - bool final_entry = false; -}; - } // namespace Common::Log |