common/logging: don't use regex for path trimming
This commit is contained in:
parent
020cd56ad8
commit
b3beff0f4c
2 changed files with 24 additions and 17 deletions
|
@ -115,15 +115,12 @@ private:
|
|||
using std::chrono::duration_cast;
|
||||
using std::chrono::steady_clock;
|
||||
|
||||
// matches from the beginning up to the last '../' or 'src/'
|
||||
static const std::regex trim_source_path(R"(.*([\/\\]|^)((\.\.)|(src))[\/\\])");
|
||||
|
||||
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 = std::regex_replace(filename, trim_source_path, "");
|
||||
entry.filename = filename;
|
||||
entry.line_num = line_nr;
|
||||
entry.function = function;
|
||||
entry.message = std::move(message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue