core/file_sys: Replace logging macros

This commit is contained in:
Daniel Lim Wee Soong
2018-06-07 23:06:44 +08:00
parent bef6c6d174
commit d81cacfb9e
16 changed files with 252 additions and 260 deletions

View File

@ -29,52 +29,50 @@ ResultVal<std::unique_ptr<FileBackend>> IVFCArchive::OpenFile(const Path& path,
}
ResultCode IVFCArchive::DeleteFile(const Path& path) const {
LOG_CRITICAL(Service_FS, "Attempted to delete a file from an IVFC archive (%s).",
GetName().c_str());
NGLOG_CRITICAL(Service_FS, "Attempted to delete a file from an IVFC archive ({}).", GetName());
// TODO(Subv): Verify error code
return ResultCode(ErrorDescription::NoData, ErrorModule::FS, ErrorSummary::Canceled,
ErrorLevel::Status);
}
ResultCode IVFCArchive::RenameFile(const Path& src_path, const Path& dest_path) const {
LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive (%s).",
GetName().c_str());
NGLOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).",
GetName());
// TODO(wwylele): Use correct error code
return ResultCode(-1);
}
ResultCode IVFCArchive::DeleteDirectory(const Path& path) const {
LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive (%s).",
GetName().c_str());
NGLOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive ({}).",
GetName());
// TODO(wwylele): Use correct error code
return ResultCode(-1);
}
ResultCode IVFCArchive::DeleteDirectoryRecursively(const Path& path) const {
LOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive (%s).",
GetName().c_str());
NGLOG_CRITICAL(Service_FS, "Attempted to delete a directory from an IVFC archive ({}).",
GetName());
// TODO(wwylele): Use correct error code
return ResultCode(-1);
}
ResultCode IVFCArchive::CreateFile(const Path& path, u64 size) const {
LOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive (%s).",
GetName().c_str());
NGLOG_CRITICAL(Service_FS, "Attempted to create a file in an IVFC archive ({}).", GetName());
// TODO: Verify error code
return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::FS, ErrorSummary::NotSupported,
ErrorLevel::Permanent);
}
ResultCode IVFCArchive::CreateDirectory(const Path& path) const {
LOG_CRITICAL(Service_FS, "Attempted to create a directory in an IVFC archive (%s).",
GetName().c_str());
NGLOG_CRITICAL(Service_FS, "Attempted to create a directory in an IVFC archive ({}).",
GetName());
// TODO(wwylele): Use correct error code
return ResultCode(-1);
}
ResultCode IVFCArchive::RenameDirectory(const Path& src_path, const Path& dest_path) const {
LOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive (%s).",
GetName().c_str());
NGLOG_CRITICAL(Service_FS, "Attempted to rename a file within an IVFC archive ({}).",
GetName());
// TODO(wwylele): Use correct error code
return ResultCode(-1);
}
@ -84,7 +82,7 @@ ResultVal<std::unique_ptr<DirectoryBackend>> IVFCArchive::OpenDirectory(const Pa
}
u64 IVFCArchive::GetFreeBytes() const {
LOG_WARNING(Service_FS, "Attempted to get the free space in an IVFC archive");
NGLOG_WARNING(Service_FS, "Attempted to get the free space in an IVFC archive");
return 0;
}
@ -97,7 +95,7 @@ IVFCFile::IVFCFile(std::shared_ptr<FileUtil::IOFile> file, u64 offset, u64 size,
}
ResultVal<size_t> IVFCFile::Read(const u64 offset, const size_t length, u8* buffer) const {
LOG_TRACE(Service_FS, "called offset=%llu, length=%zu", offset, length);
NGLOG_TRACE(Service_FS, "called offset={}, length={}", offset, length);
romfs_file->Seek(data_offset + offset, SEEK_SET);
size_t read_length = (size_t)std::min((u64)length, data_size - offset);
@ -106,7 +104,7 @@ ResultVal<size_t> IVFCFile::Read(const u64 offset, const size_t length, u8* buff
ResultVal<size_t> IVFCFile::Write(const u64 offset, const size_t length, const bool flush,
const u8* buffer) {
LOG_ERROR(Service_FS, "Attempted to write to IVFC file");
NGLOG_ERROR(Service_FS, "Attempted to write to IVFC file");
// TODO(Subv): Find error code
return MakeResult<size_t>(0);
}
@ -116,7 +114,7 @@ u64 IVFCFile::GetSize() const {
}
bool IVFCFile::SetSize(const u64 size) const {
LOG_ERROR(Service_FS, "Attempted to set the size of an IVFC file");
NGLOG_ERROR(Service_FS, "Attempted to set the size of an IVFC file");
return false;
}