mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-12 08:51:05 +00:00
Refactor executables to separate crates
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
extern crate parity_wasm;
|
||||
extern crate env_logger;
|
||||
extern crate byteorder;
|
||||
#[macro_use] extern crate log;
|
||||
#[macro_use] extern crate lazy_static;
|
||||
|
||||
pub static CREATE_SYMBOL: &'static str = "deploy";
|
||||
pub static CALL_SYMBOL: &'static str = "call";
|
||||
@@ -13,7 +11,6 @@ pub mod rules;
|
||||
mod optimizer;
|
||||
mod gas;
|
||||
mod symbols;
|
||||
mod logger;
|
||||
mod ext;
|
||||
mod pack;
|
||||
mod runtime_type;
|
||||
@@ -22,7 +19,6 @@ pub mod stack_height;
|
||||
|
||||
pub use optimizer::{optimize, Error as OptimizerError};
|
||||
pub use gas::inject_gas_counter;
|
||||
pub use logger::init_log;
|
||||
pub use ext::{externalize, externalize_mem, underscore_funcs, ununderscore_funcs, shrink_unknown_stack};
|
||||
pub use pack::{pack_instance, Error as PackingError};
|
||||
pub use runtime_type::inject_runtime_type;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
extern crate log;
|
||||
|
||||
use std::env;
|
||||
use log::LogLevelFilter;
|
||||
use env_logger::LogBuilder;
|
||||
|
||||
lazy_static! {
|
||||
static ref LOG_DUMMY: bool = {
|
||||
let mut builder = LogBuilder::new();
|
||||
builder.filter(None, LogLevelFilter::Info);
|
||||
|
||||
if let Ok(log) = env::var("RUST_LOG") {
|
||||
builder.parse(&log);
|
||||
}
|
||||
|
||||
if let Ok(_) = builder.init() {
|
||||
trace!("logger initialized");
|
||||
}
|
||||
true
|
||||
};
|
||||
}
|
||||
|
||||
/// Intialize log with default settings
|
||||
pub fn init_log() {
|
||||
let _ = *LOG_DUMMY;
|
||||
}
|
||||
Reference in New Issue
Block a user