From 0600e2d8b5b30bd68c8b19cb1f2051e096e7caa9 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Fri, 5 Dec 2014 23:53:49 -0200 Subject: Convert old logging calls to new logging macros --- src/core/file_sys/archive.h | 12 ++++++++---- src/core/file_sys/archive_romfs.cpp | 18 +++++++++--------- src/core/file_sys/archive_sdmc.cpp | 18 +++++++++--------- src/core/file_sys/directory_sdmc.cpp | 2 +- src/core/file_sys/file_sdmc.cpp | 2 +- 5 files changed, 28 insertions(+), 24 deletions(-) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/archive.h b/src/core/file_sys/archive.h index f3cb11133..27ed23cd0 100644 --- a/src/core/file_sys/archive.h +++ b/src/core/file_sys/archive.h @@ -100,7 +100,8 @@ public: case Wchar: return "[Wchar: " + AsString() + ']'; default: - ERROR_LOG(KERNEL, "LowPathType cannot be converted to string!"); + // TODO(yuriks): Add assert + LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!"); return {}; } } @@ -114,7 +115,8 @@ public: case Empty: return {}; default: - ERROR_LOG(KERNEL, "LowPathType cannot be converted to string!"); + // TODO(yuriks): Add assert + LOG_ERROR(Service_FS, "LowPathType cannot be converted to string!"); return {}; } } @@ -128,7 +130,8 @@ public: case Empty: return {}; default: - ERROR_LOG(KERNEL, "LowPathType cannot be converted to u16string!"); + // TODO(yuriks): Add assert + LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!"); return {}; } } @@ -144,7 +147,8 @@ public: case Empty: return {}; default: - ERROR_LOG(KERNEL, "LowPathType cannot be converted to binary!"); + // TODO(yuriks): Add assert + LOG_ERROR(Service_FS, "LowPathType cannot be converted to binary!"); return {}; } } diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp index 8c2dbeda5..74974c2df 100644 --- a/src/core/file_sys/archive_romfs.cpp +++ b/src/core/file_sys/archive_romfs.cpp @@ -16,7 +16,7 @@ namespace FileSys { Archive_RomFS::Archive_RomFS(const Loader::AppLoader& app_loader) { // Load the RomFS from the app if (Loader::ResultStatus::Success != app_loader.ReadRomFS(raw_data)) { - WARN_LOG(FILESYS, "Unable to read RomFS!"); + LOG_ERROR(Service_FS, "Unable to read RomFS!"); } } @@ -39,12 +39,12 @@ std::unique_ptr Archive_RomFS::OpenFile(const Path& path, const Mode mode) * @return Whether the file could be deleted */ bool Archive_RomFS::DeleteFile(const FileSys::Path& path) const { - ERROR_LOG(FILESYS, "Attempted to delete a file from ROMFS."); + LOG_WARNING(Service_FS, "Attempted to delete a file from ROMFS."); return false; } bool Archive_RomFS::RenameFile(const FileSys::Path& src_path, const FileSys::Path& dest_path) const { - ERROR_LOG(FILESYS, "Attempted to rename a file within ROMFS."); + LOG_WARNING(Service_FS, "Attempted to rename a file within ROMFS."); return false; } @@ -54,7 +54,7 @@ bool Archive_RomFS::RenameFile(const FileSys::Path& src_path, const FileSys::Pat * @return Whether the directory could be deleted */ bool Archive_RomFS::DeleteDirectory(const FileSys::Path& path) const { - ERROR_LOG(FILESYS, "Attempted to delete a directory from ROMFS."); + LOG_WARNING(Service_FS, "Attempted to delete a directory from ROMFS."); return false; } @@ -64,12 +64,12 @@ bool Archive_RomFS::DeleteDirectory(const FileSys::Path& path) const { * @return Whether the directory could be created */ bool Archive_RomFS::CreateDirectory(const Path& path) const { - ERROR_LOG(FILESYS, "Attempted to create a directory in ROMFS."); + LOG_WARNING(Service_FS, "Attempted to create a directory in ROMFS."); return false; } bool Archive_RomFS::RenameDirectory(const FileSys::Path& src_path, const FileSys::Path& dest_path) const { - ERROR_LOG(FILESYS, "Attempted to rename a file within ROMFS."); + LOG_WARNING(Service_FS, "Attempted to rename a file within ROMFS."); return false; } @@ -90,7 +90,7 @@ std::unique_ptr Archive_RomFS::OpenDirectory(const Path& path) const * @return Number of bytes read */ size_t Archive_RomFS::Read(const u64 offset, const u32 length, u8* buffer) const { - DEBUG_LOG(FILESYS, "called offset=%llu, length=%d", offset, length); + LOG_TRACE(Service_FS, "called offset=%llu, length=%d", offset, length); memcpy(buffer, &raw_data[(u32)offset], length); return length; } @@ -104,7 +104,7 @@ size_t Archive_RomFS::Read(const u64 offset, const u32 length, u8* buffer) const * @return Number of bytes written */ size_t Archive_RomFS::Write(const u64 offset, const u32 length, const u32 flush, u8* buffer) { - ERROR_LOG(FILESYS, "Attempted to write to ROMFS."); + LOG_WARNING(Service_FS, "Attempted to write to ROMFS."); return 0; } @@ -120,7 +120,7 @@ size_t Archive_RomFS::GetSize() const { * Set the size of the archive in bytes */ void Archive_RomFS::SetSize(const u64 size) { - ERROR_LOG(FILESYS, "Attempted to set the size of ROMFS"); + LOG_WARNING(Service_FS, "Attempted to set the size of ROMFS"); } } // namespace FileSys diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index fc0b9b72d..9e524b60e 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -19,7 +19,7 @@ namespace FileSys { Archive_SDMC::Archive_SDMC(const std::string& mount_point) { this->mount_point = mount_point; - DEBUG_LOG(FILESYS, "Directory %s set as SDMC.", mount_point.c_str()); + LOG_INFO(Service_FS, "Directory %s set as SDMC.", mount_point.c_str()); } Archive_SDMC::~Archive_SDMC() { @@ -31,12 +31,12 @@ Archive_SDMC::~Archive_SDMC() { */ bool Archive_SDMC::Initialize() { if (!Settings::values.use_virtual_sd) { - WARN_LOG(FILESYS, "SDMC disabled by config."); + LOG_WARNING(Service_FS, "SDMC disabled by config."); return false; } if (!FileUtil::CreateFullPath(mount_point)) { - WARN_LOG(FILESYS, "Unable to create SDMC path."); + LOG_ERROR(Service_FS, "Unable to create SDMC path."); return false; } @@ -50,7 +50,7 @@ bool Archive_SDMC::Initialize() { * @return Opened file, or nullptr */ std::unique_ptr Archive_SDMC::OpenFile(const Path& path, const Mode mode) const { - DEBUG_LOG(FILESYS, "called path=%s mode=%u", path.DebugStr().c_str(), mode.hex); + LOG_DEBUG(Service_FS, "called path=%s mode=%u", path.DebugStr().c_str(), mode.hex); File_SDMC* file = new File_SDMC(this, path, mode); if (!file->Open()) return nullptr; @@ -98,7 +98,7 @@ bool Archive_SDMC::RenameDirectory(const FileSys::Path& src_path, const FileSys: * @return Opened directory, or nullptr */ std::unique_ptr Archive_SDMC::OpenDirectory(const Path& path) const { - DEBUG_LOG(FILESYS, "called path=%s", path.DebugStr().c_str()); + LOG_DEBUG(Service_FS, "called path=%s", path.DebugStr().c_str()); Directory_SDMC* directory = new Directory_SDMC(this, path); if (!directory->Open()) return nullptr; @@ -113,7 +113,7 @@ std::unique_ptr Archive_SDMC::OpenDirectory(const Path& path) const { * @return Number of bytes read */ size_t Archive_SDMC::Read(const u64 offset, const u32 length, u8* buffer) const { - ERROR_LOG(FILESYS, "(UNIMPLEMENTED)"); + LOG_ERROR(Service_FS, "(UNIMPLEMENTED)"); return -1; } @@ -126,7 +126,7 @@ size_t Archive_SDMC::Read(const u64 offset, const u32 length, u8* buffer) const * @return Number of bytes written */ size_t Archive_SDMC::Write(const u64 offset, const u32 length, const u32 flush, u8* buffer) { - ERROR_LOG(FILESYS, "(UNIMPLEMENTED)"); + LOG_ERROR(Service_FS, "(UNIMPLEMENTED)"); return -1; } @@ -135,7 +135,7 @@ size_t Archive_SDMC::Write(const u64 offset, const u32 length, const u32 flush, * @return Size of the archive in bytes */ size_t Archive_SDMC::GetSize() const { - ERROR_LOG(FILESYS, "(UNIMPLEMENTED)"); + LOG_ERROR(Service_FS, "(UNIMPLEMENTED)"); return 0; } @@ -143,7 +143,7 @@ size_t Archive_SDMC::GetSize() const { * Set the size of the archive in bytes */ void Archive_SDMC::SetSize(const u64 size) { - ERROR_LOG(FILESYS, "(UNIMPLEMENTED)"); + LOG_ERROR(Service_FS, "(UNIMPLEMENTED)"); } /** diff --git a/src/core/file_sys/directory_sdmc.cpp b/src/core/file_sys/directory_sdmc.cpp index 0f156a127..519787641 100644 --- a/src/core/file_sys/directory_sdmc.cpp +++ b/src/core/file_sys/directory_sdmc.cpp @@ -49,7 +49,7 @@ u32 Directory_SDMC::Read(const u32 count, Entry* entries) { const std::string& filename = file.virtualName; Entry& entry = entries[entries_read]; - WARN_LOG(FILESYS, "File %s: size=%llu dir=%d", filename.c_str(), file.size, file.isDirectory); + LOG_TRACE(Service_FS, "File %s: size=%llu dir=%d", filename.c_str(), file.size, file.isDirectory); // TODO(Link Mauve): use a proper conversion to UTF-16. for (size_t j = 0; j < FILENAME_LENGTH; ++j) { diff --git a/src/core/file_sys/file_sdmc.cpp b/src/core/file_sys/file_sdmc.cpp index b01d96e3d..46c29900b 100644 --- a/src/core/file_sys/file_sdmc.cpp +++ b/src/core/file_sys/file_sdmc.cpp @@ -33,7 +33,7 @@ File_SDMC::~File_SDMC() { */ bool File_SDMC::Open() { if (!mode.create_flag && !FileUtil::Exists(path)) { - ERROR_LOG(FILESYS, "Non-existing file %s can’t be open without mode create.", path.c_str()); + LOG_ERROR(Service_FS, "Non-existing file %s can’t be open without mode create.", path.c_str()); return false; } -- cgit v1.2.3