mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-03 21:41:19 +12:00
Logging migration (forceLogDebug_printf) (#780)
* script changes - no arguments * script changes with 2 arguments * script changes with > 2 arguments * script conversions with 1 argument - pt. 1 * script conversions with 1 argument - pt. 2 * script conversions with 1 argument - pt. 3 * script conversions with 1 argument - pt. 4 * script conversions with 1 argument - pt. 5 Pointer format hunting * Fixed pointer format * script conversions with 1 argument - final * fixed conversion in non utf-8 file * fixed conversion with capital letter * actually fixed conversion with capital letter * fixed another capital lettering issue * Added conversions with LR removed * removed LR from logs * Converted logs that previously contained LR * converted log that originally specified string length * fixed log with commas in main text * fixed multi-line log * Fixed more logs with commas in main text * Fixed unformatted pointer * added conversion with float value * converted lines with double parameters * converted missed line * corrected argument formatting Co-authored-by: Crementif <26669564+Crementif@users.noreply.github.com> * Fixed misspellings of "unhandled" unhandeled -> unhandled Co-authored-by: Crementif <26669564+Crementif@users.noreply.github.com> --------- Co-authored-by: Crementif <26669564+Crementif@users.noreply.github.com>
This commit is contained in:
parent
f48ad6a1ca
commit
caa57a3cfd
98 changed files with 469 additions and 469 deletions
|
@ -239,7 +239,7 @@ namespace iosu
|
|||
// task->result_buffer.resize(task->result_buffer.size() + writeByteSize);
|
||||
//writeByteSize = min(writeByteSize, task->result_buffer.capacity() - task->processed_length);
|
||||
|
||||
//forceLogDebug_printf("task_write_callback: %d (processed: %d)", writeByteSize, task->processed_length);
|
||||
//cemuLog_logDebug(LogType::Force, "task_write_callback: {} (processed: {})", writeByteSize, task->processed_length);
|
||||
if (writeByteSize > 0)
|
||||
{
|
||||
//memcpy(task->result_buffer.data() + task->processed_length, ptr, writeByteSize);
|
||||
|
@ -252,7 +252,7 @@ namespace iosu
|
|||
|
||||
size_t task_download_header_callback(char* ptr, size_t size, size_t nitems, void* userdata)
|
||||
{
|
||||
//forceLogDebug_printf("\tHeader: %s", ptr);
|
||||
//cemuLog_logDebug(LogType::Force, "\tHeader: {}", ptr);
|
||||
|
||||
return size * nitems;
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ namespace iosu
|
|||
task->content_type = ContentType::kText;
|
||||
else
|
||||
{
|
||||
forceLogDebug_printf("task_header_callback: unknown content type > %s", type);
|
||||
cemuLog_logDebug(LogType::Force, "task_header_callback: unknown content type > {}", type);
|
||||
}
|
||||
}
|
||||
else if (starts_with(ptr, "Last-Modified: "))
|
||||
|
@ -300,8 +300,8 @@ namespace iosu
|
|||
// TODO timestamp (?)
|
||||
}
|
||||
|
||||
//forceLogDebug_printf("task_header_callback: len %d (%d) and type %d", task->content_length, task->result_buffer.capacity(), task->content_type);
|
||||
//forceLogDebug_printf("\t%s", ptr);
|
||||
//cemuLog_logDebug(LogType::Force, "task_header_callback: len {} ({}) and type {}", task->content_length, task->result_buffer.capacity(), task->content_type);
|
||||
//cemuLog_logDebug(LogType::Force, "\t{}", ptr);
|
||||
return size * nitems;
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,7 @@ namespace iosu
|
|||
auto task_settings = (TaskSetting*)param;
|
||||
if (task_settings->taskType == kRawDlTaskSetting)
|
||||
{
|
||||
forceLogDebug_printf("sslctx_function: adding client cert: %d", (int)task_settings->settings[TaskSetting::kClientCert]);
|
||||
cemuLog_logDebug(LogType::Force, "sslctx_function: adding client cert: {}", (int)task_settings->settings[TaskSetting::kClientCert]);
|
||||
if (!iosuCrypto_addClientCertificate(sslctx, task_settings->settings[TaskSetting::kClientCert]))
|
||||
assert_dbg();
|
||||
|
||||
|
@ -319,7 +319,7 @@ namespace iosu
|
|||
{
|
||||
if (task_settings->settings[location] != 0)
|
||||
{
|
||||
forceLogDebug_printf("sslctx_function: adding ca cert: %d", (int)task_settings->settings[location]);
|
||||
cemuLog_logDebug(LogType::Force, "sslctx_function: adding ca cert: {}", (int)task_settings->settings[location]);
|
||||
if (!iosuCrypto_addCACertificate(sslctx, task_settings->settings[location]))
|
||||
{
|
||||
cemuLog_log(LogType::Force, "Failed to load CA certificate file");
|
||||
|
@ -457,7 +457,7 @@ namespace iosu
|
|||
it->wait_state = TRUE;
|
||||
return BUILD_NN_RESULT(NN_RESULT_LEVEL_SUCCESS, NN_RESULT_MODULE_NN_BOSS, 0);
|
||||
}
|
||||
forceLogDebug_printf("task run state: %d | exec: %d (tasks: %d)", it->turn_state, it->exec_count, g_boss.tasks.size());
|
||||
cemuLog_logDebug(LogType::Force, "task run state: {} | exec: {} (tasks: {})", it->turn_state, it->exec_count, g_boss.tasks.size());
|
||||
it->turn_state = kRunning;
|
||||
it->exec_count++;
|
||||
|
||||
|
@ -601,25 +601,25 @@ namespace iosu
|
|||
if (curl_result != CURLE_OK)
|
||||
{
|
||||
#ifdef CEMU_DEBUG_ASSERT
|
||||
forceLogDebug_printf("curl error buff: %s", errbuf);
|
||||
cemuLog_logDebug(LogType::Force, "curl error buff: {}", errbuf);
|
||||
#endif
|
||||
it->turn_state = kError;
|
||||
it->wait_state = TRUE;
|
||||
forceLogDebug_printf("task_run curl fail: %d", curl_result);
|
||||
cemuLog_logDebug(LogType::Force, "task_run curl fail: {}", curl_result);
|
||||
return BUILD_NN_RESULT(NN_RESULT_LEVEL_FATAL, NN_RESULT_MODULE_NN_BOSS, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (it->http_status_code != 200)
|
||||
{
|
||||
forceLogDebug_printf("BOSS task_run: Received unexpected HTTP response code");
|
||||
cemuLog_logDebug(LogType::Force, "BOSS task_run: Received unexpected HTTP response code");
|
||||
}
|
||||
if (it->http_status_code == 404)
|
||||
{
|
||||
// todo - is this correct behavior?
|
||||
it->turn_state = kError;
|
||||
it->wait_state = TRUE;
|
||||
forceLogDebug_printf("task_run failed due to 404 error");
|
||||
cemuLog_logDebug(LogType::Force, "task_run failed due to 404 error");
|
||||
return BUILD_NN_RESULT(NN_RESULT_LEVEL_FATAL, NN_RESULT_MODULE_NN_BOSS, 0);
|
||||
}
|
||||
}
|
||||
|
@ -633,7 +633,7 @@ namespace iosu
|
|||
|
||||
break;
|
||||
case ContentType::kText:
|
||||
forceLogDebug_printf("task_run returns text: %.*s", it->content_length, it->result_buffer.data());
|
||||
cemuLog_logDebug(LogType::Force, "task_run returns text: {}", fmt::ptr(it->result_buffer.data()));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -653,7 +653,7 @@ namespace iosu
|
|||
|
||||
char targetFileName[TaskSetting::kFileNameLen + 1]{};
|
||||
strncpy(targetFileName, (char*)&it->task_settings.settings[TaskSetting::kNbdlFileName], TaskSetting::kFileNameLen);
|
||||
forceLogDebug_printf("\tnbdl task target filename: \"%s\"", targetFileName);
|
||||
cemuLog_logDebug(LogType::Force, "\tnbdl task target filename: \"{}\"", targetFileName);
|
||||
const bool hasFileName = targetFileName[0] != '\0';
|
||||
|
||||
while (!it->queued_files.empty())
|
||||
|
@ -704,7 +704,7 @@ namespace iosu
|
|||
curl_result = curl_easy_perform(curl);
|
||||
if (curl_result != CURLE_OK)
|
||||
{
|
||||
forceLogDebug_printf("task_run curl failed on file download (%d): %s > %s", curl_result, file.file_name.c_str(), file.url.c_str());
|
||||
cemuLog_logDebug(LogType::Force, "task_run curl failed on file download ({}): {} > {}", curl_result, file.file_name, file.url);
|
||||
if (hasFileName)
|
||||
{
|
||||
turnstate = kError;
|
||||
|
@ -727,7 +727,7 @@ namespace iosu
|
|||
|
||||
if(it->processed_file_size != file.size)
|
||||
{
|
||||
forceLogDebug_printf("task_run file download size mismatch: %s > %s > %d from %d bytes", file.file_name.c_str(), file.url.c_str(), it->processed_file_size, file.size);
|
||||
cemuLog_logDebug(LogType::Force, "task_run file download size mismatch: {} > {} > {} from {} bytes", file.file_name, file.url, it->processed_file_size, file.size);
|
||||
if (hasFileName)
|
||||
{
|
||||
turnstate = kError;
|
||||
|
@ -796,7 +796,7 @@ namespace iosu
|
|||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
forceLogDebug_printf("file error: %s", ex.what());
|
||||
cemuLog_logDebug(LogType::Force, "file error: {}", ex.what());
|
||||
}
|
||||
|
||||
if (hasFileName)
|
||||
|
@ -805,7 +805,7 @@ namespace iosu
|
|||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
forceLogDebug_printf("dir error: %s", ex.what());
|
||||
cemuLog_logDebug(LogType::Force, "dir error: {}", ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -865,7 +865,7 @@ namespace iosu
|
|||
{
|
||||
if (timeout != 0 && (uint32)std::chrono::duration_cast<std::chrono::seconds>(tick_cached() - start).count() >= timeout)
|
||||
{
|
||||
forceLogDebug_printf("task_wait: timeout reached -> %d seconds passed", timeout);
|
||||
cemuLog_logDebug(LogType::Force, "task_wait: timeout reached -> {} seconds passed", timeout);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue