From c749ca57e3054985d99ade8da0ee677396d84e11 Mon Sep 17 00:00:00 2001 From: fxliang Date: Sun, 25 Feb 2024 12:55:06 +0800 Subject: [PATCH] chore: log file_path_ when warning in tsv.cc (#825) --- src/rime/dict/tsv.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rime/dict/tsv.cc b/src/rime/dict/tsv.cc index a743e2a11..e859ab0a0 100644 --- a/src/rime/dict/tsv.cc +++ b/src/rime/dict/tsv.cc @@ -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 @@ -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;