Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: tools/gn/err.cc

Issue 23532076: GN: Add logging for the location of an invocation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iadd .cc file Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/BUILD.gn ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/err.cc
diff --git a/tools/gn/err.cc b/tools/gn/err.cc
index 326f5b372b2c185368f2b4a224f8f70d52547c56..5db3c42a959ea5f9992496a7f2fe7db6be39d9a0 100644
--- a/tools/gn/err.cc
+++ b/tools/gn/err.cc
@@ -161,21 +161,13 @@ void Err::InternalPrintToStdout(bool is_sub_err) const {
// File name and location.
const InputFile* input_file = location_.file();
- std::string loc_str;
- if (input_file) {
- std::string name;
- if (input_file->friendly_name().empty())
- name = input_file->name().value();
- else
- name = input_file->friendly_name();
-
+ std::string loc_str = location_.Describe(true);
+ if (!loc_str.empty()) {
if (is_sub_err)
- loc_str = "See ";
+ loc_str.insert(0, "See ");
else
- loc_str = "at ";
- loc_str += name + ": " +
- base::IntToString(location_.line_number()) + ":" +
- base::IntToString(location_.char_offset()) + ": ";
+ loc_str.insert(0, "at ");
+ loc_str.append(": ");
}
OutputString(loc_str + message_ + "\n");
« no previous file with comments | « tools/gn/BUILD.gn ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698