Commit 50abe47a authored by Dominik Charousset's avatar Dominik Charousset

Reduce noise in CAF logs

parent deeabd7e
...@@ -285,6 +285,9 @@ void logger::render_fun_prefix(std::ostream& out, const char* pretty_fun) { ...@@ -285,6 +285,9 @@ void logger::render_fun_prefix(std::ostream& out, const char* pretty_fun) {
// skip "virtual" prefix if present // skip "virtual" prefix if present
if (strncmp(pretty_fun, "virtual ", std::min<size_t>(strsize, 8)) == 0) if (strncmp(pretty_fun, "virtual ", std::min<size_t>(strsize, 8)) == 0)
jump_to_next_whitespace(); jump_to_next_whitespace();
// skip "static" prefix if present
if (strncmp(pretty_fun, "static ", std::min<size_t>(strsize, 7)) == 0)
jump_to_next_whitespace();
// skip return type // skip return type
jump_to_next_whitespace(); jump_to_next_whitespace();
if (first == last) if (first == last)
......
...@@ -34,7 +34,7 @@ namespace detail { ...@@ -34,7 +34,7 @@ namespace detail {
void prettify_type_name(std::string& class_name) { void prettify_type_name(std::string& class_name) {
//replace_all(class_name, " ", ""); //replace_all(class_name, " ", "");
replace_all(class_name, "::", "."); replace_all(class_name, "::", ".");
replace_all(class_name, "(anonymousnamespace)", "ANON"); replace_all(class_name, "(anonymous namespace)", "ANON");
replace_all(class_name, ".__1.", "."); // gets rid of weird Clang-lib names replace_all(class_name, ".__1.", "."); // gets rid of weird Clang-lib names
// hide CAF magic in logs // hide CAF magic in logs
auto strip_magic = [&](const char* prefix_begin, const char* prefix_end) { auto strip_magic = [&](const char* prefix_begin, const char* prefix_end) {
...@@ -49,7 +49,11 @@ void prettify_type_name(std::string& class_name) { ...@@ -49,7 +49,11 @@ void prettify_type_name(std::string& class_name) {
}; };
char prefix1[] = "caf.detail.embedded<"; char prefix1[] = "caf.detail.embedded<";
strip_magic(prefix1, prefix1 + (sizeof(prefix1) - 1)); strip_magic(prefix1, prefix1 + (sizeof(prefix1) - 1));
// finally, replace any whitespace with %20 // Drop template parameters, only leaving the template class name.
auto i = std::find(class_name.begin(), class_name.end(), '<');
if (i != class_name.end())
class_name.erase(i, class_name.end());
// Finally, replace any whitespace with %20 (should never happen).
replace_all(class_name, " ", "%20"); replace_all(class_name, " ", "%20");
} }
...@@ -72,5 +76,5 @@ std::string pretty_type_name(const std::type_info& x) { ...@@ -72,5 +76,5 @@ std::string pretty_type_name(const std::type_info& x) {
return result; return result;
} }
} // namespace detail } // namespace detail
} // namespace caf } // namespace caf
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment