summaryrefslogtreecommitdiff
path: root/src/common/logging/backend.h
diff options
context:
space:
mode:
authorGravatar Morph2021-06-13 10:31:47 -0400
committerGravatar Morph2021-06-13 11:05:58 -0400
commit391e823c797ba61791eeb98180ed5ea657b7d4c4 (patch)
tree31b852202d266375808c79c9f447791db36407bf /src/common/logging/backend.h
parentcommon: logging: backend: Wrap IOFile in a unique_ptr (diff)
downloadyuzu-391e823c797ba61791eeb98180ed5ea657b7d4c4.tar.gz
yuzu-391e823c797ba61791eeb98180ed5ea657b7d4c4.tar.xz
yuzu-391e823c797ba61791eeb98180ed5ea657b7d4c4.zip
common: logging: Restructure backend code
Diffstat (limited to 'src/common/logging/backend.h')
-rw-r--r--src/common/logging/backend.h28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h
index 826bde694..4b9a910c1 100644
--- a/src/common/logging/backend.h
+++ b/src/common/logging/backend.h
@@ -1,9 +1,9 @@
1// Copyright 2014 Citra Emulator Project 1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4
4#pragma once 5#pragma once
5 6
6#include <chrono>
7#include <filesystem> 7#include <filesystem>
8#include <memory> 8#include <memory>
9#include <string> 9#include <string>
@@ -20,21 +20,6 @@ namespace Common::Log {
20class Filter; 20class Filter;
21 21
22/** 22/**
23 * A log entry. Log entries are store in a structured format to permit more varied output
24 * formatting on different frontends, as well as facilitating filtering and aggregation.
25 */
26struct Entry {
27 std::chrono::microseconds timestamp;
28 Class log_class{};
29 Level log_level{};
30 const char* filename = nullptr;
31 unsigned int line_num = 0;
32 std::string function;
33 std::string message;
34 bool final_entry = false;
35};
36
37/**
38 * Interface for logging backends. As loggers can be created and removed at runtime, this can be 23 * Interface for logging backends. As loggers can be created and removed at runtime, this can be
39 * used by a frontend for adding a custom logging backend as needed 24 * used by a frontend for adding a custom logging backend as needed
40 */ 25 */
@@ -131,17 +116,6 @@ void RemoveBackend(std::string_view backend_name);
131Backend* GetBackend(std::string_view backend_name); 116Backend* GetBackend(std::string_view backend_name);
132 117
133/** 118/**
134 * Returns the name of the passed log class as a C-string. Subclasses are separated by periods
135 * instead of underscores as in the enumeration.
136 */
137const char* GetLogClassName(Class log_class);
138
139/**
140 * Returns the name of the passed log level as a C-string.
141 */
142const char* GetLevelName(Level log_level);
143
144/**
145 * The global filter will prevent any messages from even being processed if they are filtered. Each 119 * The global filter will prevent any messages from even being processed if they are filtered. Each
146 * backend can have a filter, but if the level is lower than the global filter, the backend will 120 * backend can have a filter, but if the level is lower than the global filter, the backend will
147 * never get the message 121 * never get the message