From 16a61d5c4b1faff9571a3f02ebaeecc7684603af Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 28 Jun 2022 11:00:47 +0200 Subject: Use a more meaningful abbreviation of expression values ... in error messages. The outer structure is usually more important than the the details of the first element. --- src/buildtool/build_engine/expression/configuration.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/buildtool/build_engine/expression/configuration.hpp') diff --git a/src/buildtool/build_engine/expression/configuration.hpp b/src/buildtool/build_engine/expression/configuration.hpp index 5d0b9c2a..3306d293 100644 --- a/src/buildtool/build_engine/expression/configuration.hpp +++ b/src/buildtool/build_engine/expression/configuration.hpp @@ -47,10 +47,10 @@ class Configuration { size_t actual_width = width - prefix.size(); for (auto const& [key, value] : expr_->Map()) { std::string key_str = Expression{key}.ToString(); - std::string val_str = value->ToString(); if (actual_width > key_str.size() + 3) { ss << prefix << key_str << " : "; size_t remain = actual_width - key_str.size() - 3; + std::string val_str = value->ToAbbrevString(remain); if (val_str.size() >= remain) { ss << val_str.substr(0, remain - 3) << "..."; } -- cgit v1.2.3