Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: log file_path_ when warning in tsv.cc #825

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/rime/dict/tsv.cc
Original file line number Diff line number Diff line change
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
Loading