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

@ -160,10 +160,10 @@ jit_compiler_compile(WASMModule *module, uint32 func_idx)
#if WASM_ENABLE_CUSTOM_NAME_SECTION != 0
char *function_name = cc->cur_wasm_func->field_name;
os_printf("fast jit compilation failed: %s (function_name=%s)\n",
LOG_ERROR("fast jit compilation failed: %s (function_name=%s)\n",
last_error ? last_error : "unknown error", function_name);
#else
os_printf("fast jit compilation failed: %s\n",
LOG_ERROR("fast jit compilation failed: %s\n",
last_error ? last_error : "unknown error");
#endif

View File

@ -1093,7 +1093,7 @@ init_func_translation(JitCompContext *cc)
|| !(jit_frame = jit_calloc(offsetof(JitFrame, lp)
+ sizeof(*jit_frame->lp)
* (max_locals + max_stacks)))) {
os_printf("allocate jit frame failed\n");
LOG_ERROR("allocate jit frame failed\n");
return NULL;
}