diff options
author | bunnei <bunneidev@gmail.com> | 2020-08-06 04:34:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-06 04:34:12 +0200 |
commit | d888ac7d20e2300f9fdb595716bcfe158ea012ca (patch) | |
tree | b4d42fbdee48251fe9f6ff7ce9d3cbe8f67f4f09 /src | |
parent | Merge pull request #4475 from lioncash/bqueue (diff) | |
parent | logging/backend: Make use of designated initializers (diff) | |
download | yuzu-d888ac7d20e2300f9fdb595716bcfe158ea012ca.tar yuzu-d888ac7d20e2300f9fdb595716bcfe158ea012ca.tar.gz yuzu-d888ac7d20e2300f9fdb595716bcfe158ea012ca.tar.bz2 yuzu-d888ac7d20e2300f9fdb595716bcfe158ea012ca.tar.lz yuzu-d888ac7d20e2300f9fdb595716bcfe158ea012ca.tar.xz yuzu-d888ac7d20e2300f9fdb595716bcfe158ea012ca.tar.zst yuzu-d888ac7d20e2300f9fdb595716bcfe158ea012ca.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/common/logging/backend.cpp | 22 | ||||
-rw-r--r-- | src/common/logging/backend.h | 14 |
2 files changed, 15 insertions, 21 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 04bc3128f..62cfde397 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -113,19 +113,19 @@ private: Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr, const char* function, std::string message) const { using std::chrono::duration_cast; + using std::chrono::microseconds; using std::chrono::steady_clock; - Entry entry; - entry.timestamp = - duration_cast<std::chrono::microseconds>(steady_clock::now() - time_origin); - entry.log_class = log_class; - entry.log_level = log_level; - entry.filename = filename; - entry.line_num = line_nr; - entry.function = function; - entry.message = std::move(message); - - return entry; + return { + .timestamp = duration_cast<microseconds>(steady_clock::now() - time_origin), + .log_class = log_class, + .log_level = log_level, + .filename = filename, + .line_num = line_nr, + .function = function, + .message = std::move(message), + .final_entry = false, + }; } std::mutex writing_mutex; diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h index fc338c70d..e5d702568 100644 --- a/src/common/logging/backend.h +++ b/src/common/logging/backend.h @@ -21,19 +21,13 @@ class Filter; */ struct Entry { std::chrono::microseconds timestamp; - Class log_class; - Level log_level; - const char* filename; - unsigned int line_num; + 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; - - Entry() = default; - Entry(Entry&& o) = default; - - Entry& operator=(Entry&& o) = default; - Entry& operator=(const Entry& o) = default; }; /** |