Skip to content

Commit

Permalink
chore: log file_path_ when warning in tsv.cc (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Feb 25, 2024
1 parent c3edda7 commit 10cb298
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rime/dict/tsv.cc
Expand Up @@ -34,7 +34,8 @@ int TsvReader::operator()(Sink* sink) {
line.erase(0, 2);
boost::algorithm::split(row, line, boost::algorithm::is_any_of("\t"));
if (row.size() != 2 || !sink->MetaPut(row[0], row[1])) {
LOG(WARNING) << "invalid metadata at line " << line_no << ".";
LOG(WARNING) << "invalid metadata at line " << line_no
<< " in file: " << file_path_ << ".";
}
} else if (line == "# no comment") {
// a "# no comment" line disables further comments
Expand All @@ -45,7 +46,8 @@ int TsvReader::operator()(Sink* sink) {
// read a tsv entry
boost::algorithm::split(row, line, boost::algorithm::is_any_of("\t"));
if (!parser_(row, &key, &value) || !sink->Put(key, value)) {
LOG(WARNING) << "invalid entry at line " << line_no << ".";
LOG(WARNING) << "invalid entry at line " << line_no
<< " in file: " << file_path_ << ".";
continue;
}
++num_entries;
Expand Down

0 comments on commit 10cb298

Please sign in to comment.