Merge pull request #1217 from jhump/jh/make-warning-useful

make 'no syntax' warning useful by showing which file
This commit is contained in:
Joshua Haberman 2016-02-11 10:43:47 -08:00
commit 655a9d667f

View file

@ -544,9 +544,9 @@ bool Parser::Parse(io::Tokenizer* input, FileDescriptorProto* file) {
// Store the syntax into the file.
if (file != NULL) file->set_syntax(syntax_identifier_);
} else if (!stop_after_syntax_identifier_) {
GOOGLE_LOG(WARNING) << "No syntax specified for the proto file. "
<< "Please use 'syntax = \"proto2\";' or "
<< "'syntax = \"proto3\";' to specify a syntax "
GOOGLE_LOG(WARNING) << "No syntax specified for the proto file: "
<< file->name() << ". Please use 'syntax = \"proto2\";' "
<< "or 'syntax = \"proto3\";' to specify a syntax "
<< "version. (Defaulted to proto2 syntax.)";
syntax_identifier_ = "proto2";
}