diff --git a/CHANGELOG.md b/CHANGELOG.md index 62805ceb3ff..841a009f417 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## **[Unreleased]** +- [#1147](https://github.com/wasmerio/wasmer/pull/1147) Remove `log` and `trace` macros from `wasmer-runtime-core`, remove `debug` and `trace` features from `wasmer-*` crates, use the `log` crate for logging and use `fern` in the Wasmer CLI binary to output log messages. To disable colorized output, set the `WASMER_DISABLE_COLOR` environment variable. - [#1128](https://github.com/wasmerio/wasmer/pull/1128) Fix a crash when a host function is missing and the `allow_missing_functions` flag is enabled - [#1099](https://github.com/wasmerio/wasmer/pull/1099) Remove `backend::Backend` from `wasmer_runtime_core` - [#1097](https://github.com/wasmerio/wasmer/pull/1097) Move inline breakpoint outside of runtime backend diff --git a/Cargo.lock b/Cargo.lock index 063b85e4105..a8df02ffb20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1934,6 +1934,7 @@ dependencies = [ name = "wasmer-wasi-experimental-io-devices" version = "0.12.0" dependencies = [ + "log", "minifb", "ref_thread_local", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3c0e06e81c3..998d146686e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,10 +81,9 @@ typetag = "0.1" # used by the plugin example [features] default = ["fast-tests", "wasi", "backend-cranelift"] "loader-kernel" = ["wasmer-kernel-loader"] -debug = ["wasmer-runtime-core/debug", "fern", "log/max_level_debug", "log/release_max_level_debug"] -trace = ["wasmer-runtime-core/trace", "log/max_level_trace", "log/release_max_level_trace"] +debug = ["fern", "log/max_level_debug", "log/release_max_level_debug"] +trace = ["fern", "log/max_level_trace", "log/release_max_level_trace"] docs = ["wasmer-runtime/docs"] -extra-debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"] # This feature will allow cargo test to run much faster fast-tests = [] backend-cranelift = [ diff --git a/lib/clif-backend/Cargo.toml b/lib/clif-backend/Cargo.toml index b619c384f16..12fc35f481e 100644 --- a/lib/clif-backend/Cargo.toml +++ b/lib/clif-backend/Cargo.toml @@ -37,7 +37,4 @@ version = "0.0.7" [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["errhandlingapi", "minwindef", "minwinbase", "winnt"] } -wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.12.0" } - -[features] -debug = ["wasmer-runtime-core/debug"] +wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.12.0" } \ No newline at end of file diff --git a/lib/emscripten/Cargo.toml b/lib/emscripten/Cargo.toml index d921ed42fb7..c1d1ade35a0 100644 --- a/lib/emscripten/Cargo.toml +++ b/lib/emscripten/Cargo.toml @@ -19,6 +19,3 @@ wasmer-runtime-core = { path = "../runtime-core", version = "0.12.0" } [target.'cfg(windows)'.dependencies] getrandom = "0.1" - -[features] -debug = ["wasmer-runtime-core/debug"] diff --git a/lib/llvm-backend/Cargo.toml b/lib/llvm-backend/Cargo.toml index bb0c7e2c541..558b9d7fb8f 100644 --- a/lib/llvm-backend/Cargo.toml +++ b/lib/llvm-backend/Cargo.toml @@ -46,5 +46,4 @@ rustc_version = "0.2" wabt = "0.9.1" [features] -debug = ["wasmer-runtime-core/debug"] test = [] diff --git a/lib/runtime-c-api/Cargo.toml b/lib/runtime-c-api/Cargo.toml index 4e7654b9d39..eb09775d711 100644 --- a/lib/runtime-c-api/Cargo.toml +++ b/lib/runtime-c-api/Cargo.toml @@ -39,7 +39,6 @@ optional = true [features] default = ["cranelift-backend", "wasi"] -debug = ["wasmer-runtime/debug"] singlepass-backend = ["wasmer-runtime/singlepass", "wasmer-runtime/default-backend-singlepass"] cranelift-backend = ["wasmer-runtime/cranelift", "wasmer-runtime/default-backend-cranelift"] llvm-backend = ["wasmer-runtime/llvm", "wasmer-runtime/default-backend-llvm"] diff --git a/lib/runtime-core/Cargo.toml b/lib/runtime-core/Cargo.toml index b8d781ed4c2..cf7d0af3d66 100644 --- a/lib/runtime-core/Cargo.toml +++ b/lib/runtime-core/Cargo.toml @@ -50,7 +50,5 @@ rustc_version = "0.2" cc = "1.0" [features] -debug = [] -trace = ["debug"] managed = [] deterministic-execution = ["wasmparser/deterministic"] diff --git a/lib/runtime/Cargo.toml b/lib/runtime/Cargo.toml index e3b135226cc..e4057999764 100644 --- a/lib/runtime/Cargo.toml +++ b/lib/runtime/Cargo.toml @@ -46,7 +46,6 @@ default = ["cranelift", "default-backend-cranelift"] docs = [] cranelift = ["wasmer-clif-backend"] cache = ["cranelift"] -debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"] llvm = ["wasmer-llvm-backend"] singlepass = ["wasmer-singlepass-backend"] default-backend-singlepass = ["singlepass"] diff --git a/lib/wasi-experimental-io-devices/Cargo.toml b/lib/wasi-experimental-io-devices/Cargo.toml index 8727ba80579..4ba1e74ab58 100644 --- a/lib/wasi-experimental-io-devices/Cargo.toml +++ b/lib/wasi-experimental-io-devices/Cargo.toml @@ -12,6 +12,7 @@ license = "MIT" maintenance = { status = "experimental" } [dependencies] +log = "0.4" minifb = "0.13" wasmer-wasi = { version = "0.12.0", path = "../wasi" } wasmer-runtime-core = { version = "0.12.0", path = "../runtime-core" } diff --git a/lib/wasi-experimental-io-devices/src/lib.rs b/lib/wasi-experimental-io-devices/src/lib.rs index 2fa3d1d7923..07edb8f7ce1 100644 --- a/lib/wasi-experimental-io-devices/src/lib.rs +++ b/lib/wasi-experimental-io-devices/src/lib.rs @@ -1,8 +1,10 @@ +#[macro_use] +extern crate log; + use serde::{Deserialize, Serialize}; use std::collections::{BTreeSet, VecDeque}; use std::convert::TryInto; use std::io::{Read, Seek, SeekFrom, Write}; -use wasmer_runtime_core::debug; use wasmer_wasi::{ state::{Fd, WasiFile, WasiFs, WasiFsError, ALL_RIGHTS, VIRTUAL_ROOT_FD}, types::*, diff --git a/lib/wasi/src/syscalls/windows.rs b/lib/wasi/src/syscalls/windows.rs index 6c0cff71bcb..f6559290bbc 100644 --- a/lib/wasi/src/syscalls/windows.rs +++ b/lib/wasi/src/syscalls/windows.rs @@ -1,6 +1,5 @@ use crate::syscalls::types::*; use std::cell::Cell; -use wasmer_runtime_core::debug; pub fn platform_clock_res_get( clock_id: __wasi_clockid_t, diff --git a/src/bin/wasmer.rs b/src/bin/wasmer.rs index 5a77e3336fd..67b3bbe452b 100644 --- a/src/bin/wasmer.rs +++ b/src/bin/wasmer.rs @@ -984,7 +984,7 @@ fn get_backend(backend: Backend, path: &PathBuf) -> Backend { fn run(options: &mut Run) { options.backend = get_backend(options.backend, &options.path); - #[cfg(feature = "debug")] + #[cfg(any(feature = "debug", feature = "trace"))] { if options.debug { logging::set_up_logging().expect("failed to set up logging");