From 2e5a8099334a6a5e095bab486dcddd481c093c24 Mon Sep 17 00:00:00 2001 From: liyong Date: Sat, 12 Sep 2020 16:19:54 +0800 Subject: [PATCH] fix mindrecord log --- .../ccsrc/minddata/mindrecord/meta/shard_header.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mindspore/ccsrc/minddata/mindrecord/meta/shard_header.cc b/mindspore/ccsrc/minddata/mindrecord/meta/shard_header.cc index a90753ef69..46c9a91fd4 100644 --- a/mindspore/ccsrc/minddata/mindrecord/meta/shard_header.cc +++ b/mindspore/ccsrc/minddata/mindrecord/meta/shard_header.cc @@ -81,14 +81,14 @@ MSRStatus ShardHeader::CheckFileStatus(const std::string &path) { auto &io_seekg = fin.seekg(0, std::ios::end); if (!io_seekg.good() || io_seekg.fail() || io_seekg.bad()) { fin.close(); - MS_LOG(ERROR) << "File seekg failed"; + MS_LOG(ERROR) << "File seekg failed. path: " << path; return FAILED; } size_t file_size = fin.tellg(); if (file_size < kMinFileSize) { fin.close(); - MS_LOG(ERROR) << "File size %d is smaller than the minimum value."; + MS_LOG(ERROR) << "Invalid file. path: " << path; return FAILED; } fin.close(); @@ -104,7 +104,7 @@ std::pair ShardHeader::ValidateHeader(const std::string &path) json json_header; std::ifstream fin(common::SafeCStr(path), std::ios::in | std::ios::binary); if (!fin.is_open()) { - MS_LOG(ERROR) << "File seekg failed"; + MS_LOG(ERROR) << "File seekg failed. path: " << path; return {FAILED, json_header}; } @@ -118,7 +118,7 @@ std::pair ShardHeader::ValidateHeader(const std::string &path) if (header_size > kMaxHeaderSize) { fin.close(); - MS_LOG(ERROR) << "Header size is illegal."; + MS_LOG(ERROR) << "Invalid file. path: " << path; return {FAILED, json_header}; } @@ -126,7 +126,7 @@ std::pair ShardHeader::ValidateHeader(const std::string &path) std::vector header_content(header_size); auto &io_read_content = fin.read(reinterpret_cast(&header_content[0]), header_size); if (!io_read_content.good() || io_read_content.fail() || io_read_content.bad()) { - MS_LOG(ERROR) << "File read failed"; + MS_LOG(ERROR) << "File read failed. path: " << path; fin.close(); return {FAILED, json_header}; }