mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-06-07 05:39:16 +00:00
Expose API to set log level in embedder (#2907)
Expose API `void wasm_runtime_set_log_level(log_level_t level)`.
This commit is contained in:
parent
b5022015fc
commit
6dbfeb25dd
|
@ -701,6 +701,12 @@ wasm_runtime_full_init(RuntimeInitArgs *init_args)
|
|||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
wasm_runtime_set_log_level(log_level_t level)
|
||||
{
|
||||
bh_log_set_verbose_level(level);
|
||||
}
|
||||
|
||||
bool
|
||||
wasm_runtime_is_running_mode_supported(RunningMode running_mode)
|
||||
{
|
||||
|
|
|
@ -212,6 +212,14 @@ typedef struct wasm_val_t {
|
|||
} wasm_val_t;
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
WASM_LOG_LEVEL_FATAL = 0,
|
||||
WASM_LOG_LEVEL_ERROR = 1,
|
||||
WASM_LOG_LEVEL_WARNING = 2,
|
||||
WASM_LOG_LEVEL_DEBUG = 3,
|
||||
WASM_LOG_LEVEL_VERBOSE = 4
|
||||
} log_level_t;
|
||||
|
||||
/**
|
||||
* Initialize the WASM runtime environment, and also initialize
|
||||
* the memory allocator with system allocator, which calls os_malloc
|
||||
|
@ -234,6 +242,14 @@ wasm_runtime_init(void);
|
|||
WASM_RUNTIME_API_EXTERN bool
|
||||
wasm_runtime_full_init(RuntimeInitArgs *init_args);
|
||||
|
||||
/**
|
||||
* Set the log level. To be called after the runtime is initialized.
|
||||
*
|
||||
* @param level the log level to set
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN void
|
||||
wasm_runtime_set_log_level(log_level_t level);
|
||||
|
||||
/**
|
||||
* Query whether a certain running mode is supported for the runtime
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user