WHBANG commented on code in PR #1318:
URL:
https://github.com/apache/incubator-pegasus/pull/1318#discussion_r1073284131
##########
src/replica/replica_restore.cpp:
##########
@@ -44,7 +44,7 @@ bool replica::remove_useless_file_under_chkpt(const
std::string &chkpt_dir,
// filename --> file_path such as: file --> ***/***/file
std::map<std::string, std::string> name_to_filepath;
if (!::dsn::utils::filesystem::get_subfiles(chkpt_dir, sub_files, false)) {
- LOG_ERROR("%s: get subfile of dir(%s) failed", name(),
chkpt_dir.c_str());
+ LOG_ERROR_PREFIX("get subfile of dir(%s) failed", chkpt_dir);
Review Comment:
done
##########
src/replica/log_file.cpp:
##########
@@ -203,27 +202,27 @@ error_code log_file::read_next_log_block(/*out*/
::dsn::blob &bb)
// if read_count is 0, then we meet the end of file
err = (bb.length() == 0 ? ERR_HANDLE_EOF : ERR_INCOMPLETE_DATA);
} else {
- LOG_ERROR("read data block header failed, size = %d vs %d, err =
%s",
- bb.length(),
- (int)sizeof(log_block_header),
- err.to_string());
+ LOG_ERROR_F("read data block header failed, size = {} vs {}, err =
{}",
+ bb.length(),
+ (int)sizeof(log_block_header),
Review Comment:
done
##########
src/replica/log_file.cpp:
##########
@@ -203,27 +202,27 @@ error_code log_file::read_next_log_block(/*out*/
::dsn::blob &bb)
// if read_count is 0, then we meet the end of file
err = (bb.length() == 0 ? ERR_HANDLE_EOF : ERR_INCOMPLETE_DATA);
} else {
- LOG_ERROR("read data block header failed, size = %d vs %d, err =
%s",
- bb.length(),
- (int)sizeof(log_block_header),
- err.to_string());
+ LOG_ERROR_F("read data block header failed, size = {} vs {}, err =
{}",
+ bb.length(),
+ (int)sizeof(log_block_header),
+ err);
}
return err;
}
log_block_header hdr = *reinterpret_cast<const log_block_header
*>(bb.data());
if (hdr.magic != 0xdeadbeef) {
- LOG_ERROR("invalid data header magic: 0x%x", hdr.magic);
+ LOG_ERROR_F("invalid data header magic: {:#x}",
static_cast<uint32_t>(hdr.magic));
return ERR_INVALID_DATA;
}
err = _stream->read_next(hdr.length, bb);
if (err != ERR_OK || hdr.length != bb.length()) {
- LOG_ERROR("read data block body failed, size = %d vs %d, err = %s",
- bb.length(),
- (int)hdr.length,
- err.to_string());
+ LOG_ERROR_F("read data block body failed, size = {} vs {}, err = {}",
+ bb.length(),
+ (int)hdr.length,
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]