Skip to content

Conversation

@eloparco
Copy link
Contributor

No description provided.

Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

wasm_runtime_full_init(RuntimeInitArgs *init_args);

/**
* Set the log level. To be called after the runtime is created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had better change created to initialized?

@eloparco eloparco force-pushed the eloparco/set-log-level-embedder branch from d043de5 to 0022e87 Compare December 15, 2023 01:18
BH_LOG_LEVEL_ERROR = 1,
BH_LOG_LEVEL_WARNING = 2,
BH_LOG_LEVEL_DEBUG = 3,
BH_LOG_LEVEL_VERBOSE = 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if these are for wasm_runtime_set_log_level, it seems a bit odd to use BH_ prefix. how do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing to WASM_LOG_LEVEL_*? Or is there other suggestion?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing to WASM_LOG_LEVEL_*?

it sounds better to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to me too. @eloparco, could you help update the code? Thanks.

@eloparco eloparco force-pushed the eloparco/set-log-level-embedder branch from 0022e87 to fb80982 Compare December 15, 2023 09:34
@eloparco eloparco force-pushed the eloparco/set-log-level-embedder branch 3 times, most recently from 64a4118 to 0b79345 Compare December 15, 2023 09:57
@eloparco
Copy link
Contributor Author

[build_iwasm ($CLASSIC_INTERP_BUILD_OPTIONS, -DWAMR_BUILD_LIB_PTHREAD=1, macos-latest, darwin)](https://github.com/bytecodealliance/wasm-micro-runtime/actions/runs/7220553955/job/19673804322)
GitHub Actions has encountered an internal error when running your job.

I'm amending the commit to restart the job.

@eloparco eloparco force-pushed the eloparco/set-log-level-embedder branch from 0b79345 to 2979b51 Compare December 15, 2023 10:24
@wenyongh wenyongh merged commit 6dbfeb2 into bytecodealliance:main Dec 15, 2023
wenyongh pushed a commit that referenced this pull request Jan 24, 2024
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.
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
Expose API `void wasm_runtime_set_log_level(log_level_t level)`.
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…#3070)

Follow-up on bytecodealliance#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants