mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-10 06:38:22 +00:00
Fix the debug config feature and --debug flag.
This commit is contained in:
@@ -45,7 +45,9 @@ distance = "0.4"
|
|||||||
# For the inspect subcommand
|
# For the inspect subcommand
|
||||||
bytesize = "1.0"
|
bytesize = "1.0"
|
||||||
cfg-if = "0.1"
|
cfg-if = "0.1"
|
||||||
|
# For debug feature
|
||||||
|
fern = { version = "0.6", features = ["colored"], optional = true }
|
||||||
|
log = { version = "0.4", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# Don't add the compiler features in default, please add them on the Makefile
|
# Don't add the compiler features in default, please add them on the Makefile
|
||||||
@@ -94,3 +96,4 @@ llvm = [
|
|||||||
"wasmer-compiler-llvm",
|
"wasmer-compiler-llvm",
|
||||||
"compiler",
|
"compiler",
|
||||||
]
|
]
|
||||||
|
debug = ["fern", "log"]
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::get_cache_dir;
|
use crate::common::get_cache_dir;
|
||||||
|
use crate::logging;
|
||||||
use crate::store::{CompilerType, EngineType, StoreOptions};
|
use crate::store::{CompilerType, EngineType, StoreOptions};
|
||||||
use crate::suggestions::suggest_function_exports;
|
use crate::suggestions::suggest_function_exports;
|
||||||
use crate::warning;
|
use crate::warning;
|
||||||
@@ -70,6 +71,10 @@ pub struct Run {
|
|||||||
impl Run {
|
impl Run {
|
||||||
/// Execute the run command
|
/// Execute the run command
|
||||||
pub fn execute(&self) -> Result<()> {
|
pub fn execute(&self) -> Result<()> {
|
||||||
|
#[cfg(feature = "debug")]
|
||||||
|
if self.debug {
|
||||||
|
logging::set_up_logging().unwrap();
|
||||||
|
}
|
||||||
self.inner_execute().with_context(|| {
|
self.inner_execute().with_context(|| {
|
||||||
let compilers = CompilerType::enabled()
|
let compilers = CompilerType::enabled()
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//! Logging functions for the debug feature.
|
||||||
use crate::utils::wasmer_should_print_color;
|
use crate::utils::wasmer_should_print_color;
|
||||||
use fern::colors::{Color, ColoredLevelConfig};
|
use fern::colors::{Color, ColoredLevelConfig};
|
||||||
use std::time;
|
use std::time;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ byteorder = "1.3"
|
|||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
generational-arena = { version = "0.2", features = ["serde"] }
|
generational-arena = { version = "0.2", features = ["serde"] }
|
||||||
libc = { version = "^0.2.69", default-features = false }
|
libc = { version = "^0.2.69", default-features = false }
|
||||||
tracing = "0.1"
|
tracing = { version = "0.1", features = ["log"] }
|
||||||
getrandom = "0.1"
|
getrandom = "0.1"
|
||||||
time = "0.1"
|
time = "0.1"
|
||||||
typetag = "0.1"
|
typetag = "0.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user