Use logger for runtime error/debug prints (#3097)

Change runtime internal error/debug prints from using `os_printf()`
to using `LOG_ERROR()`/`LOG_DEBUG()`.
This commit is contained in:
Enrico Loparco
2024-02-06 06:02:54 +01:00
committed by GitHub
parent f359b51525
commit cfa90ca44f
11 changed files with 35 additions and 35 deletions

View File

@ -3300,7 +3300,7 @@ orcjit_thread_callback(void *arg)
/* Compile fast jit funcitons of this group */
for (i = group_idx; i < func_count; i += group_stride) {
if (!jit_compiler_compile(module, i + module->import_function_count)) {
os_printf("failed to compile fast jit function %u\n", i);
LOG_ERROR("failed to compile fast jit function %u\n", i);
break;
}
@ -3327,7 +3327,7 @@ orcjit_thread_callback(void *arg)
if (!jit_compiler_set_call_to_fast_jit(
module,
i + j * group_stride + module->import_function_count)) {
os_printf(
LOG_ERROR(
"failed to compile call_to_fast_jit for func %u\n",
i + j * group_stride + module->import_function_count);
module->orcjit_stop_compiling = true;
@ -3377,7 +3377,7 @@ orcjit_thread_callback(void *arg)
LLVMOrcLLLazyJITLookup(comp_ctx->orc_jit, &func_addr, func_name);
if (error != LLVMErrorSuccess) {
char *err_msg = LLVMGetErrorMessage(error);
os_printf("failed to compile llvm jit function %u: %s", i, err_msg);
LOG_ERROR("failed to compile llvm jit function %u: %s", i, err_msg);
LLVMDisposeErrorMessage(err_msg);
break;
}
@ -3398,7 +3398,7 @@ orcjit_thread_callback(void *arg)
func_name);
if (error != LLVMErrorSuccess) {
char *err_msg = LLVMGetErrorMessage(error);
os_printf("failed to compile llvm jit function %u: %s", i,
LOG_ERROR("failed to compile llvm jit function %u: %s", i,
err_msg);
LLVMDisposeErrorMessage(err_msg);
/* Ignore current llvm jit func, as its func ptr is

View File

@ -2024,7 +2024,7 @@ orcjit_thread_callback(void *arg)
/* Compile fast jit funcitons of this group */
for (i = group_idx; i < func_count; i += group_stride) {
if (!jit_compiler_compile(module, i + module->import_function_count)) {
os_printf("failed to compile fast jit function %u\n", i);
LOG_ERROR("failed to compile fast jit function %u\n", i);
break;
}
@ -2051,7 +2051,7 @@ orcjit_thread_callback(void *arg)
if (!jit_compiler_set_call_to_fast_jit(
module,
i + j * group_stride + module->import_function_count)) {
os_printf(
LOG_ERROR(
"failed to compile call_to_fast_jit for func %u\n",
i + j * group_stride + module->import_function_count);
module->orcjit_stop_compiling = true;
@ -2101,7 +2101,7 @@ orcjit_thread_callback(void *arg)
LLVMOrcLLLazyJITLookup(comp_ctx->orc_jit, &func_addr, func_name);
if (error != LLVMErrorSuccess) {
char *err_msg = LLVMGetErrorMessage(error);
os_printf("failed to compile llvm jit function %u: %s", i, err_msg);
LOG_ERROR("failed to compile llvm jit function %u: %s", i, err_msg);
LLVMDisposeErrorMessage(err_msg);
break;
}
@ -2122,7 +2122,7 @@ orcjit_thread_callback(void *arg)
func_name);
if (error != LLVMErrorSuccess) {
char *err_msg = LLVMGetErrorMessage(error);
os_printf("failed to compile llvm jit function %u: %s", i,
LOG_ERROR("failed to compile llvm jit function %u: %s", i,
err_msg);
LLVMDisposeErrorMessage(err_msg);
/* Ignore current llvm jit func, as its func ptr is