diff options
| author | 2018-04-24 10:20:50 -0400 | |
|---|---|---|
| committer | 2018-04-24 12:00:52 -0400 | |
| commit | b5b613ea29d7d6d2ea2c11396c6464078082c62d (patch) | |
| tree | 30cc6c366e843a64c562effb4d7d5473a00fef7d /src | |
| parent | fatal: Move logging macros over to new fmt-compatible ones (diff) | |
| download | yuzu-b5b613ea29d7d6d2ea2c11396c6464078082c62d.tar.gz yuzu-b5b613ea29d7d6d2ea2c11396c6464078082c62d.tar.xz yuzu-b5b613ea29d7d6d2ea2c11396c6464078082c62d.zip | |
filesystem: Move logging macros over to new fmt-compatible ones
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 51 |
2 files changed, 29 insertions, 30 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 9e504992f..c2951c560 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -25,14 +25,14 @@ ResultCode RegisterFileSystem(std::unique_ptr<FileSys::FileSystemFactory>&& fact | |||
| 25 | ASSERT_MSG(inserted, "Tried to register more than one system with same id code"); | 25 | ASSERT_MSG(inserted, "Tried to register more than one system with same id code"); |
| 26 | 26 | ||
| 27 | auto& filesystem = result.first->second; | 27 | auto& filesystem = result.first->second; |
| 28 | LOG_DEBUG(Service_FS, "Registered file system %s with id code 0x%08X", | 28 | NGLOG_DEBUG(Service_FS, "Registered file system {} with id code {:#010X}", |
| 29 | filesystem->GetName().c_str(), static_cast<u32>(type)); | 29 | filesystem->GetName(), static_cast<u32>(type)); |
| 30 | return RESULT_SUCCESS; | 30 | return RESULT_SUCCESS; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | ResultVal<std::unique_ptr<FileSys::FileSystemBackend>> OpenFileSystem(Type type, | 33 | ResultVal<std::unique_ptr<FileSys::FileSystemBackend>> OpenFileSystem(Type type, |
| 34 | FileSys::Path& path) { | 34 | FileSys::Path& path) { |
| 35 | LOG_TRACE(Service_FS, "Opening FileSystem with type=%d", type); | 35 | NGLOG_TRACE(Service_FS, "Opening FileSystem with type={}", static_cast<u32>(type)); |
| 36 | 36 | ||
| 37 | auto itr = filesystem_map.find(type); | 37 | auto itr = filesystem_map.find(type); |
| 38 | if (itr == filesystem_map.end()) { | 38 | if (itr == filesystem_map.end()) { |
| @@ -44,7 +44,7 @@ ResultVal<std::unique_ptr<FileSys::FileSystemBackend>> OpenFileSystem(Type type, | |||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | ResultCode FormatFileSystem(Type type) { | 46 | ResultCode FormatFileSystem(Type type) { |
| 47 | LOG_TRACE(Service_FS, "Formatting FileSystem with type=%d", type); | 47 | NGLOG_TRACE(Service_FS, "Formatting FileSystem with type={}", static_cast<u32>(type)); |
| 48 | 48 | ||
| 49 | auto itr = filesystem_map.find(type); | 49 | auto itr = filesystem_map.find(type); |
| 50 | if (itr == filesystem_map.end()) { | 50 | if (itr == filesystem_map.end()) { |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 02e270f26..ed9f2ef72 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -35,7 +35,7 @@ private: | |||
| 35 | const s64 offset = rp.Pop<s64>(); | 35 | const s64 offset = rp.Pop<s64>(); |
| 36 | const s64 length = rp.Pop<s64>(); | 36 | const s64 length = rp.Pop<s64>(); |
| 37 | 37 | ||
| 38 | LOG_DEBUG(Service_FS, "called, offset=0x%ld, length=0x%ld", offset, length); | 38 | NGLOG_DEBUG(Service_FS, "called, offset={:#X}, length={}", offset, length); |
| 39 | 39 | ||
| 40 | // Error checking | 40 | // Error checking |
| 41 | if (length < 0) { | 41 | if (length < 0) { |
| @@ -87,7 +87,7 @@ private: | |||
| 87 | const s64 offset = rp.Pop<s64>(); | 87 | const s64 offset = rp.Pop<s64>(); |
| 88 | const s64 length = rp.Pop<s64>(); | 88 | const s64 length = rp.Pop<s64>(); |
| 89 | 89 | ||
| 90 | LOG_DEBUG(Service_FS, "called, offset=0x%ld, length=0x%ld", offset, length); | 90 | NGLOG_DEBUG(Service_FS, "called, offset={:#X}, length={}", offset, length); |
| 91 | 91 | ||
| 92 | // Error checking | 92 | // Error checking |
| 93 | if (length < 0) { | 93 | if (length < 0) { |
| @@ -124,7 +124,7 @@ private: | |||
| 124 | const s64 offset = rp.Pop<s64>(); | 124 | const s64 offset = rp.Pop<s64>(); |
| 125 | const s64 length = rp.Pop<s64>(); | 125 | const s64 length = rp.Pop<s64>(); |
| 126 | 126 | ||
| 127 | LOG_DEBUG(Service_FS, "called, offset=0x%ld, length=0x%ld", offset, length); | 127 | NGLOG_DEBUG(Service_FS, "called, offset={:#X}, length={}", offset, length); |
| 128 | 128 | ||
| 129 | // Error checking | 129 | // Error checking |
| 130 | if (length < 0) { | 130 | if (length < 0) { |
| @@ -152,7 +152,7 @@ private: | |||
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | void Flush(Kernel::HLERequestContext& ctx) { | 154 | void Flush(Kernel::HLERequestContext& ctx) { |
| 155 | LOG_DEBUG(Service_FS, "called"); | 155 | NGLOG_DEBUG(Service_FS, "called"); |
| 156 | backend->Flush(); | 156 | backend->Flush(); |
| 157 | 157 | ||
| 158 | IPC::ResponseBuilder rb{ctx, 2}; | 158 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -163,7 +163,7 @@ private: | |||
| 163 | IPC::RequestParser rp{ctx}; | 163 | IPC::RequestParser rp{ctx}; |
| 164 | const u64 size = rp.Pop<u64>(); | 164 | const u64 size = rp.Pop<u64>(); |
| 165 | backend->SetSize(size); | 165 | backend->SetSize(size); |
| 166 | LOG_DEBUG(Service_FS, "called, size=%" PRIu64, size); | 166 | NGLOG_DEBUG(Service_FS, "called, size={}", size); |
| 167 | 167 | ||
| 168 | IPC::ResponseBuilder rb{ctx, 2}; | 168 | IPC::ResponseBuilder rb{ctx, 2}; |
| 169 | rb.Push(RESULT_SUCCESS); | 169 | rb.Push(RESULT_SUCCESS); |
| @@ -171,7 +171,7 @@ private: | |||
| 171 | 171 | ||
| 172 | void GetSize(Kernel::HLERequestContext& ctx) { | 172 | void GetSize(Kernel::HLERequestContext& ctx) { |
| 173 | const u64 size = backend->GetSize(); | 173 | const u64 size = backend->GetSize(); |
| 174 | LOG_DEBUG(Service_FS, "called, size=%" PRIu64, size); | 174 | NGLOG_DEBUG(Service_FS, "called, size={}", size); |
| 175 | 175 | ||
| 176 | IPC::ResponseBuilder rb{ctx, 4}; | 176 | IPC::ResponseBuilder rb{ctx, 4}; |
| 177 | rb.Push(RESULT_SUCCESS); | 177 | rb.Push(RESULT_SUCCESS); |
| @@ -197,7 +197,7 @@ private: | |||
| 197 | IPC::RequestParser rp{ctx}; | 197 | IPC::RequestParser rp{ctx}; |
| 198 | const u64 unk = rp.Pop<u64>(); | 198 | const u64 unk = rp.Pop<u64>(); |
| 199 | 199 | ||
| 200 | LOG_DEBUG(Service_FS, "called, unk=0x%llx", unk); | 200 | NGLOG_DEBUG(Service_FS, "called, unk={:#X}", unk); |
| 201 | 201 | ||
| 202 | // Calculate how many entries we can fit in the output buffer | 202 | // Calculate how many entries we can fit in the output buffer |
| 203 | u64 count_entries = ctx.GetWriteBufferSize() / sizeof(FileSys::Entry); | 203 | u64 count_entries = ctx.GetWriteBufferSize() / sizeof(FileSys::Entry); |
| @@ -219,7 +219,7 @@ private: | |||
| 219 | } | 219 | } |
| 220 | 220 | ||
| 221 | void GetEntryCount(Kernel::HLERequestContext& ctx) { | 221 | void GetEntryCount(Kernel::HLERequestContext& ctx) { |
| 222 | LOG_DEBUG(Service_FS, "called"); | 222 | NGLOG_DEBUG(Service_FS, "called"); |
| 223 | 223 | ||
| 224 | u64 count = backend->GetEntryCount(); | 224 | u64 count = backend->GetEntryCount(); |
| 225 | 225 | ||
| @@ -265,8 +265,7 @@ public: | |||
| 265 | u64 mode = rp.Pop<u64>(); | 265 | u64 mode = rp.Pop<u64>(); |
| 266 | u32 size = rp.Pop<u32>(); | 266 | u32 size = rp.Pop<u32>(); |
| 267 | 267 | ||
| 268 | LOG_DEBUG(Service_FS, "called file %s mode 0x%" PRIX64 " size 0x%08X", name.c_str(), mode, | 268 | NGLOG_DEBUG(Service_FS, "called file {} mode {:#X} size {:#010X}", name, mode, size); |
| 269 | size); | ||
| 270 | 269 | ||
| 271 | IPC::ResponseBuilder rb{ctx, 2}; | 270 | IPC::ResponseBuilder rb{ctx, 2}; |
| 272 | rb.Push(backend->CreateFile(name, size)); | 271 | rb.Push(backend->CreateFile(name, size)); |
| @@ -280,7 +279,7 @@ public: | |||
| 280 | 279 | ||
| 281 | std::string name(file_buffer.begin(), end); | 280 | std::string name(file_buffer.begin(), end); |
| 282 | 281 | ||
| 283 | LOG_DEBUG(Service_FS, "called file %s", name.c_str()); | 282 | NGLOG_DEBUG(Service_FS, "called file {}", name); |
| 284 | 283 | ||
| 285 | IPC::ResponseBuilder rb{ctx, 2}; | 284 | IPC::ResponseBuilder rb{ctx, 2}; |
| 286 | rb.Push(backend->DeleteFile(name)); | 285 | rb.Push(backend->DeleteFile(name)); |
| @@ -294,7 +293,7 @@ public: | |||
| 294 | 293 | ||
| 295 | std::string name(file_buffer.begin(), end); | 294 | std::string name(file_buffer.begin(), end); |
| 296 | 295 | ||
| 297 | LOG_DEBUG(Service_FS, "called directory %s", name.c_str()); | 296 | NGLOG_DEBUG(Service_FS, "called directory {}", name); |
| 298 | 297 | ||
| 299 | IPC::ResponseBuilder rb{ctx, 2}; | 298 | IPC::ResponseBuilder rb{ctx, 2}; |
| 300 | rb.Push(backend->CreateDirectory(name)); | 299 | rb.Push(backend->CreateDirectory(name)); |
| @@ -314,7 +313,7 @@ public: | |||
| 314 | end = std::find(buffer.begin(), buffer.end(), '\0'); | 313 | end = std::find(buffer.begin(), buffer.end(), '\0'); |
| 315 | std::string dst_name(buffer.begin(), end); | 314 | std::string dst_name(buffer.begin(), end); |
| 316 | 315 | ||
| 317 | LOG_DEBUG(Service_FS, "called file '%s' to file '%s'", src_name.c_str(), dst_name.c_str()); | 316 | NGLOG_DEBUG(Service_FS, "called file '{}' to file '{}'", src_name, dst_name); |
| 318 | 317 | ||
| 319 | IPC::ResponseBuilder rb{ctx, 2}; | 318 | IPC::ResponseBuilder rb{ctx, 2}; |
| 320 | rb.Push(backend->RenameFile(src_name, dst_name)); | 319 | rb.Push(backend->RenameFile(src_name, dst_name)); |
| @@ -330,7 +329,7 @@ public: | |||
| 330 | 329 | ||
| 331 | auto mode = static_cast<FileSys::Mode>(rp.Pop<u32>()); | 330 | auto mode = static_cast<FileSys::Mode>(rp.Pop<u32>()); |
| 332 | 331 | ||
| 333 | LOG_DEBUG(Service_FS, "called file %s mode %u", name.c_str(), static_cast<u32>(mode)); | 332 | NGLOG_DEBUG(Service_FS, "called file {} mode {}", name, static_cast<u32>(mode)); |
| 334 | 333 | ||
| 335 | auto result = backend->OpenFile(name, mode); | 334 | auto result = backend->OpenFile(name, mode); |
| 336 | if (result.Failed()) { | 335 | if (result.Failed()) { |
| @@ -357,7 +356,7 @@ public: | |||
| 357 | // TODO(Subv): Implement this filter. | 356 | // TODO(Subv): Implement this filter. |
| 358 | u32 filter_flags = rp.Pop<u32>(); | 357 | u32 filter_flags = rp.Pop<u32>(); |
| 359 | 358 | ||
| 360 | LOG_DEBUG(Service_FS, "called directory %s filter %u", name.c_str(), filter_flags); | 359 | NGLOG_DEBUG(Service_FS, "called directory {} filter {}", name, filter_flags); |
| 361 | 360 | ||
| 362 | auto result = backend->OpenDirectory(name); | 361 | auto result = backend->OpenDirectory(name); |
| 363 | if (result.Failed()) { | 362 | if (result.Failed()) { |
| @@ -381,7 +380,7 @@ public: | |||
| 381 | 380 | ||
| 382 | std::string name(file_buffer.begin(), end); | 381 | std::string name(file_buffer.begin(), end); |
| 383 | 382 | ||
| 384 | LOG_DEBUG(Service_FS, "called file %s", name.c_str()); | 383 | NGLOG_DEBUG(Service_FS, "called file {}", name); |
| 385 | 384 | ||
| 386 | auto result = backend->GetEntryType(name); | 385 | auto result = backend->GetEntryType(name); |
| 387 | if (result.Failed()) { | 386 | if (result.Failed()) { |
| @@ -396,7 +395,7 @@ public: | |||
| 396 | } | 395 | } |
| 397 | 396 | ||
| 398 | void Commit(Kernel::HLERequestContext& ctx) { | 397 | void Commit(Kernel::HLERequestContext& ctx) { |
| 399 | LOG_WARNING(Service_FS, "(STUBBED) called"); | 398 | NGLOG_WARNING(Service_FS, "(STUBBED) called"); |
| 400 | 399 | ||
| 401 | IPC::ResponseBuilder rb{ctx, 2}; | 400 | IPC::ResponseBuilder rb{ctx, 2}; |
| 402 | rb.Push(RESULT_SUCCESS); | 401 | rb.Push(RESULT_SUCCESS); |
| @@ -512,14 +511,14 @@ void FSP_SRV::TryLoadRomFS() { | |||
| 512 | } | 511 | } |
| 513 | 512 | ||
| 514 | void FSP_SRV::Initialize(Kernel::HLERequestContext& ctx) { | 513 | void FSP_SRV::Initialize(Kernel::HLERequestContext& ctx) { |
| 515 | LOG_WARNING(Service_FS, "(STUBBED) called"); | 514 | NGLOG_WARNING(Service_FS, "(STUBBED) called"); |
| 516 | 515 | ||
| 517 | IPC::ResponseBuilder rb{ctx, 2}; | 516 | IPC::ResponseBuilder rb{ctx, 2}; |
| 518 | rb.Push(RESULT_SUCCESS); | 517 | rb.Push(RESULT_SUCCESS); |
| 519 | } | 518 | } |
| 520 | 519 | ||
| 521 | void FSP_SRV::MountSdCard(Kernel::HLERequestContext& ctx) { | 520 | void FSP_SRV::MountSdCard(Kernel::HLERequestContext& ctx) { |
| 522 | LOG_DEBUG(Service_FS, "called"); | 521 | NGLOG_DEBUG(Service_FS, "called"); |
| 523 | 522 | ||
| 524 | FileSys::Path unused; | 523 | FileSys::Path unused; |
| 525 | auto filesystem = OpenFileSystem(Type::SDMC, unused).Unwrap(); | 524 | auto filesystem = OpenFileSystem(Type::SDMC, unused).Unwrap(); |
| @@ -536,14 +535,14 @@ void FSP_SRV::CreateSaveData(Kernel::HLERequestContext& ctx) { | |||
| 536 | auto save_create_struct = rp.PopRaw<std::array<u8, 0x40>>(); | 535 | auto save_create_struct = rp.PopRaw<std::array<u8, 0x40>>(); |
| 537 | u128 uid = rp.PopRaw<u128>(); | 536 | u128 uid = rp.PopRaw<u128>(); |
| 538 | 537 | ||
| 539 | LOG_WARNING(Service_FS, "(STUBBED) called uid = %016" PRIX64 "%016" PRIX64, uid[1], uid[0]); | 538 | NGLOG_WARNING(Service_FS, "(STUBBED) called uid = {:016X}{:016X}", uid[1], uid[0]); |
| 540 | 539 | ||
| 541 | IPC::ResponseBuilder rb{ctx, 2}; | 540 | IPC::ResponseBuilder rb{ctx, 2}; |
| 542 | rb.Push(RESULT_SUCCESS); | 541 | rb.Push(RESULT_SUCCESS); |
| 543 | } | 542 | } |
| 544 | 543 | ||
| 545 | void FSP_SRV::MountSaveData(Kernel::HLERequestContext& ctx) { | 544 | void FSP_SRV::MountSaveData(Kernel::HLERequestContext& ctx) { |
| 546 | LOG_WARNING(Service_FS, "(STUBBED) called"); | 545 | NGLOG_WARNING(Service_FS, "(STUBBED) called"); |
| 547 | 546 | ||
| 548 | FileSys::Path unused; | 547 | FileSys::Path unused; |
| 549 | auto filesystem = OpenFileSystem(Type::SaveData, unused).Unwrap(); | 548 | auto filesystem = OpenFileSystem(Type::SaveData, unused).Unwrap(); |
| @@ -554,7 +553,7 @@ void FSP_SRV::MountSaveData(Kernel::HLERequestContext& ctx) { | |||
| 554 | } | 553 | } |
| 555 | 554 | ||
| 556 | void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | 555 | void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { |
| 557 | LOG_WARNING(Service_FS, "(STUBBED) called"); | 556 | NGLOG_WARNING(Service_FS, "(STUBBED) called"); |
| 558 | 557 | ||
| 559 | IPC::ResponseBuilder rb{ctx, 3}; | 558 | IPC::ResponseBuilder rb{ctx, 3}; |
| 560 | rb.Push(RESULT_SUCCESS); | 559 | rb.Push(RESULT_SUCCESS); |
| @@ -562,12 +561,12 @@ void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | |||
| 562 | } | 561 | } |
| 563 | 562 | ||
| 564 | void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { | 563 | void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { |
| 565 | LOG_DEBUG(Service_FS, "called"); | 564 | NGLOG_DEBUG(Service_FS, "called"); |
| 566 | 565 | ||
| 567 | TryLoadRomFS(); | 566 | TryLoadRomFS(); |
| 568 | if (!romfs) { | 567 | if (!romfs) { |
| 569 | // TODO (bunnei): Find the right error code to use here | 568 | // TODO (bunnei): Find the right error code to use here |
| 570 | LOG_CRITICAL(Service_FS, "no file system interface available!"); | 569 | NGLOG_CRITICAL(Service_FS, "no file system interface available!"); |
| 571 | IPC::ResponseBuilder rb{ctx, 2}; | 570 | IPC::ResponseBuilder rb{ctx, 2}; |
| 572 | rb.Push(ResultCode(-1)); | 571 | rb.Push(ResultCode(-1)); |
| 573 | return; | 572 | return; |
| @@ -576,7 +575,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { | |||
| 576 | // Attempt to open a StorageBackend interface to the RomFS | 575 | // Attempt to open a StorageBackend interface to the RomFS |
| 577 | auto storage = romfs->OpenFile({}, {}); | 576 | auto storage = romfs->OpenFile({}, {}); |
| 578 | if (storage.Failed()) { | 577 | if (storage.Failed()) { |
| 579 | LOG_CRITICAL(Service_FS, "no storage interface available!"); | 578 | NGLOG_CRITICAL(Service_FS, "no storage interface available!"); |
| 580 | IPC::ResponseBuilder rb{ctx, 2}; | 579 | IPC::ResponseBuilder rb{ctx, 2}; |
| 581 | rb.Push(storage.Code()); | 580 | rb.Push(storage.Code()); |
| 582 | return; | 581 | return; |
| @@ -588,7 +587,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { | |||
| 588 | } | 587 | } |
| 589 | 588 | ||
| 590 | void FSP_SRV::OpenRomStorage(Kernel::HLERequestContext& ctx) { | 589 | void FSP_SRV::OpenRomStorage(Kernel::HLERequestContext& ctx) { |
| 591 | LOG_WARNING(Service_FS, "(STUBBED) called, using OpenDataStorageByCurrentProcess"); | 590 | NGLOG_WARNING(Service_FS, "(STUBBED) called, using OpenDataStorageByCurrentProcess"); |
| 592 | OpenDataStorageByCurrentProcess(ctx); | 591 | OpenDataStorageByCurrentProcess(ctx); |
| 593 | } | 592 | } |
| 594 | 593 | ||