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