summaryrefslogtreecommitdiff
path: root/src/common/logging/backend.h
diff options
context:
space:
mode:
authorGravatar Daniel Lim Wee Soong2018-03-22 18:21:29 +0800
committerGravatar Daniel Lim Wee Soong2018-03-22 18:21:29 +0800
commit3b558eebee54fa4bc9d1a7bb428d4bd33e1b817e (patch)
treec6e2a53e92f1ef289edf26212a0f82fb0c97e718 /src/common/logging/backend.h
parentMerge pull request #215 from N00byKing/umapsharedmmry (diff)
downloadyuzu-3b558eebee54fa4bc9d1a7bb428d4bd33e1b817e.tar.gz
yuzu-3b558eebee54fa4bc9d1a7bb428d4bd33e1b817e.tar.xz
yuzu-3b558eebee54fa4bc9d1a7bb428d4bd33e1b817e.zip
Logging: Create logging macros based on fmtlib
Add a new set of logging macros based on fmtlib Similar but not exactly the same as https://github.com/citra-emu/citra/pull/3533 Citra currently uses a different version of fmt, which does not support FMT_VARIADIC so make_args is used instead. On the other hand, yuzu uses fmt 4.1.0 which doesn't have make_args yet so FMT_VARIADIC is used.
Diffstat (limited to 'src/common/logging/backend.h')
-rw-r--r--src/common/logging/backend.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h
index 70744e3e5..7e81efb23 100644
--- a/src/common/logging/backend.h
+++ b/src/common/logging/backend.h
@@ -22,13 +22,16 @@ struct Entry {
22 std::chrono::microseconds timestamp; 22 std::chrono::microseconds timestamp;
23 Class log_class; 23 Class log_class;
24 Level log_level; 24 Level log_level;
25 std::string location; 25 std::string filename;
26 unsigned int line_num;
27 std::string function;
26 std::string message; 28 std::string message;
27 29
28 Entry() = default; 30 Entry() = default;
29 Entry(Entry&& o) = default; 31 Entry(Entry&& o) = default;
30 32
31 Entry& operator=(Entry&& o) = default; 33 Entry& operator=(Entry&& o) = default;
34 Entry& operator=(const Entry& o) = default;
32}; 35};
33 36
34/** 37/**
@@ -44,7 +47,7 @@ const char* GetLevelName(Level log_level);
44 47
45/// Creates a log entry by formatting the given source location, and message. 48/// Creates a log entry by formatting the given source location, and message.
46Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr, 49Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr,
47 const char* function, const char* format, va_list args); 50 const char* function, std::string message);
48 51
49void SetFilter(Filter* filter); 52void SetFilter(Filter* filter);
50} // namespace Log 53} // namespace Log