From f4634ccd4ae01da313eb57ed215ea80f1d70217d Mon Sep 17 00:00:00 2001 From: vms Date: Fri, 5 Feb 2021 12:14:42 +0300 Subject: [PATCH] update greeting example --- Cargo.lock | 8 ++++---- examples/greeting/artifacts/greeting.wasm | Bin 69880 -> 70471 bytes tools/repl/src/logger.rs | 11 +++++++---- tools/repl/src/repl.rs | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f4da90f2..9ded3f9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2431,9 +2431,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8208a331e1cb318dd5bd76951d2b8fc48ca38a69f5f4e4af1b6a9f8c6236915" +checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ "once_cell", ] @@ -2542,9 +2542,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" +checksum = "f7d40a22fd029e33300d8d89a5cc8ffce18bb7c587662f54629e94c9de5487f3" dependencies = [ "cfg-if 1.0.0", "log", diff --git a/examples/greeting/artifacts/greeting.wasm b/examples/greeting/artifacts/greeting.wasm index 82025d1d1839bd7986f81cd4724a7175ab99f05e..511bbf2b53da5299cc9109ac9a7aebfef02ae1f1 100755 GIT binary patch delta 7741 zcmc&&3v^V~xjy^MWHQNQ$VqsU5YB`Efe1P82hSYp5CSO3t#ajB;XH-m5eT5x2SKg! zP$Br+1}y@Lq9R!6fLNgzsV!bgD+*qr_+W`rL8?$Kf+*a7&mfW;|8}B7U z7m>Qserl8(Rz7{m3uHjY8}53BbQUKrCc=bX%SiQXILh|Q)w)buPVz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=*Whfoc}%M;9X)8axs-?qGOnD zazXZrLNWoSe{~gyrQPsF6|V%*mP{LVd{tBGB0V+q*-wdr?#S@bSM@)zHODp8l%|Tl zqhV@FF8Q8QWycd0Kc(A(B1@`jCmVwR;>?t5;)w#ftEjSM!ae8ojG#CeRK6(+NGJ3* zx%7LqYo03zvhC>j01+h9Pd0zwhLo$@o?xQ?0VR@GUmNgYPR;Zm*TCU__Py^JQqSq4 zrn*Qxs@)a@X(&DxiEQynH%mIR;iIS~jvKBoxnF(CX{w+kV z?d^LK@(L4@tD2Ieh{>DDcLPn89UJ3BFwrn%qOk3WFo_UOM%Jjdq+%Xd6a;+Riv=W1 zIMeWD-w_?j)KvkqdiFqsEaVhJG-cH>4b@R}H>GEPQb^i3-!WZPQ*=WRbWCJk_H-e6 zo>NRwl3Zkh=cuY{NZCI}$uLfJbSITE#FVVLnEcgjsEB;Tr9{KPLg0It$Zf@wvurVO zI4lqj#w-#Ab0X%uY;!TWgwrrdreq`W?w;5Ojpm=#Yh!K zn2MPTOCVCx#Dbb#5F?{F$rLoKsaPFTDN(kS?B*Dm$O(q0qGO(bc~({wF^k^=YB)4T z$Gb;5qEboKvuX)RB9TQ|lRaFmp_h)7y`zK}<&LMyCKfr#*KydCk`HBDONhn^_^S1! z6c%Dd_V7xxed6S@QQt!$K@eSA(@>viBHDKLbezoU{`DJ~mjp>1DbWAh=5-?n!~X&v Cm+LVA diff --git a/tools/repl/src/logger.rs b/tools/repl/src/logger.rs index c6611c8a..78ff51a9 100644 --- a/tools/repl/src/logger.rs +++ b/tools/repl/src/logger.rs @@ -14,14 +14,16 @@ * limitations under the License. */ +use fluence_sdk_main::WASM_LOG_ENV_NAME; + +use std::io::Write; +use std::env::var; + const WIT_MODULE_PATH: &str = "wasmer_interface_types_fl"; const RUST_LOG_ENV_NAME: &str = "RUST_LOG"; pub(super) fn init_logger() { - use std::io::Write; - use std::env::var; use log::LevelFilter::Info; - use fluence_sdk_main::WASM_LOG_ENV_NAME; match (var(RUST_LOG_ENV_NAME), var(WASM_LOG_ENV_NAME)) { (Ok(_), _) => {} @@ -37,7 +39,8 @@ pub(super) fn init_logger() { Some(module_path) if module_path.starts_with(WIT_MODULE_PATH) => { writeln!(buf, "[host] {}", record.args()) } - // because of the log_utf8_string implementation, log from a wasm module always has module path + // due to the log_utf8_string implementation, + // a log message from a Wasm module always has module path None => writeln!(buf, "[host] {}", record.args()), Some(module_path) => writeln!(buf, "[{}] {}", module_path, record.args()), } diff --git a/tools/repl/src/repl.rs b/tools/repl/src/repl.rs index bfcce666..7d0e6e60 100644 --- a/tools/repl/src/repl.rs +++ b/tools/repl/src/repl.rs @@ -16,13 +16,13 @@ mod print_state; +use print_state::print_envs; +use print_state::print_fs_state; use crate::ReplResult; use fluence_app_service::AppService; use fluence_app_service::FaaSModuleConfig; use fluence_app_service::TomlAppServiceConfig; -use print_state::print_envs; -use print_state::print_fs_state; use std::collections::HashMap; use std::fs;