Forward log and log level to custom bh_log callback (#3070)

Follow-up on #2907. The log level is needed in the host embedder to
better integrate with the embedder's logger.

Allow the developer to customize his bh_log callback with
`cmake -DWAMR_BH_LOG=<log_callback>`,
and update sample/basic to show the usage.
This commit is contained in:
Enrico Loparco
2024-01-24 06:05:07 +01:00
committed by GitHub
parent 1505e61704
commit 3fcd79867d
6 changed files with 50 additions and 3 deletions

View File

@ -21,7 +21,7 @@ echo "#####################build basic project"
cd ${CURR_DIR}
mkdir -p cmake_build
cd cmake_build
cmake .. -DCMAKE_BUILD_TYPE=Debug
cmake .. -DCMAKE_BUILD_TYPE=Debug -DWAMR_BH_VPRINTF=my_vprintf -DWAMR_BH_LOG=my_log
make -j ${nproc}
if [ $? != 0 ];then
echo "BUILD_FAIL basic exit as $?\n"