From 98a96c5068da14ed29d70ca23818b5f408a2e7b4 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Tue, 13 Feb 2024 11:53:56 -0800 Subject: [PATCH] [Protobuf] Absorb protobuf::MultiFileErrorCollector change 2 (#35898) Additional touch on top of https://github.com/grpc/grpc/pull/35870 Closes #35898 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35898 from veblush:protobuf-sv 3b8410b6f6e574c9069196acd558184230e9196e PiperOrigin-RevId: 606699149 --- test/cpp/util/proto_file_parser.cc | 8 ++++---- tools/distrib/python/grpcio_tools/grpc_tools/main.cc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/cpp/util/proto_file_parser.cc b/test/cpp/util/proto_file_parser.cc index 97ac68f1795..5e570c57372 100644 --- a/test/cpp/util/proto_file_parser.cc +++ b/test/cpp/util/proto_file_parser.cc @@ -48,16 +48,16 @@ class ErrorPrinter : public protobuf::compiler::MultiFileErrorCollector { public: explicit ErrorPrinter(ProtoFileParser* parser) : parser_(parser) {} - void AddError(const std::string& filename, int line, int column, - const std::string& message) override { + void RecordError(absl::string_view filename, int line, int column, + absl::string_view message) override { std::ostringstream oss; oss << "error " << filename << " " << line << " " << column << " " << message << "\n"; parser_->LogError(oss.str()); } - void AddWarning(const std::string& filename, int line, int column, - const std::string& message) override { + void RecordWarning(absl::string_view filename, int line, int column, + absl::string_view message) override { std::cerr << "warning " << filename << " " << line << " " << column << " " << message << std::endl; } diff --git a/tools/distrib/python/grpcio_tools/grpc_tools/main.cc b/tools/distrib/python/grpcio_tools/grpc_tools/main.cc index 1d9749861bc..9302cc75529 100644 --- a/tools/distrib/python/grpcio_tools/grpc_tools/main.cc +++ b/tools/distrib/python/grpcio_tools/grpc_tools/main.cc @@ -108,13 +108,13 @@ class ErrorCollectorImpl : public MultiFileErrorCollector { : errors_(errors), warnings_(warnings) {} void RecordError(absl::string_view filename, int line, int column, - absl::string_view message) { + absl::string_view message) override { errors_->emplace_back(std::string(filename), line, column, std::string(message)); } void RecordWarning(absl::string_view filename, int line, int column, - absl::string_view message) { + absl::string_view message) override { warnings_->emplace_back(std::string(filename), line, column, std::string(message)); }