From de3d51ef8f558b1f056be188a8c8d0979508f99a Mon Sep 17 00:00:00 2001 From: vms Date: Tue, 8 Dec 2020 18:15:18 +0300 Subject: [PATCH] refactor logger --- Cargo.lock | 108 ++++++++++++------ examples/ipfs-node/effector/src/main.rs | 4 +- examples/ipfs-node/pure/src/main.rs | 4 +- examples/url-downloader/artifacts/curl.wasm | Bin 80044 -> 80042 bytes examples/url-downloader/artifacts/facade.wasm | Bin 81048 -> 81055 bytes .../artifacts/local_storage.wasm | Bin 87156 -> 88055 bytes examples/url-downloader/curl/src/main.rs | 7 +- examples/url-downloader/facade/src/main.rs | 7 +- .../url-downloader/local_storage/Cargo.toml | 2 +- .../url-downloader/local_storage/src/main.rs | 9 +- fluence-faas/src/faas.rs | 8 ++ fluence-faas/src/lib.rs | 1 + .../{misc => logger}/log_utf8_string_impl.rs | 4 +- fluence-faas/src/logger/logger_filter.rs | 102 +++++++++++++++++ fluence-faas/src/logger/mod.rs | 23 ++++ fluence-faas/src/misc/mod.rs | 3 - fluence-faas/src/misc/utils.rs | 20 +++- 17 files changed, 241 insertions(+), 61 deletions(-) rename fluence-faas/src/{misc => logger}/log_utf8_string_impl.rs (96%) create mode 100644 fluence-faas/src/logger/logger_filter.rs create mode 100644 fluence-faas/src/logger/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 8077b730..326473d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,9 +35,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf8dcb5b4bbaa28653b647d8c77bd4ed40183b48882e130c1f1ffb73de069fd7" +checksum = "2c0df63cb2955042487fad3aefd2c6e3ae7389ac5dc1beb28921de0b69f779d4" [[package]] name = "aquamarine-vm" @@ -189,9 +189,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95752358c8f7552394baf48cd82695b345628ad3f170d607de3ca03b8dacca15" +checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" [[package]] name = "cfg-if" @@ -690,7 +690,7 @@ name = "fce-wit-generator" version = "0.1.11" dependencies = [ "fce-wit-parser", - "fluence-sdk-wit 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "fluence-sdk-wit 0.2.9", "once_cell", "serde", "serde_json", @@ -737,17 +737,26 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1099731bb64286758969fb8dd6f903d1e4a7398d8e63bdec1be6387576f4d8ab" dependencies = [ - "fluence-sdk-macro 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "fluence-sdk-main 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "fluence-sdk-macro 0.2.9", + "fluence-sdk-main 0.2.9", ] [[package]] name = "fluence" version = "0.2.9" -source = "git+https://github.com/fluencelabs/rust-sdk#fd9672636e8d7a91275e5e0b8b88a34494336e5a" +source = "git+https://github.com/fluencelabs/rust-sdk?branch=logger_env#be250f9c1f75309b1d96d78dbfd380a8fae7fd3f" dependencies = [ - "fluence-sdk-macro 0.2.9 (git+https://github.com/fluencelabs/rust-sdk)", - "fluence-sdk-main 0.2.9 (git+https://github.com/fluencelabs/rust-sdk)", + "fluence-sdk-macro 0.2.10 (git+https://github.com/fluencelabs/rust-sdk?branch=logger_env)", + "fluence-sdk-main 0.2.10 (git+https://github.com/fluencelabs/rust-sdk?branch=logger_env)", +] + +[[package]] +name = "fluence" +version = "0.2.9" +source = "git+https://github.com/fluencelabs/rust-sdk#ebf3e63aef8d4aafda41180eeb299c4138628174" +dependencies = [ + "fluence-sdk-macro 0.2.10 (git+https://github.com/fluencelabs/rust-sdk)", + "fluence-sdk-main 0.2.10 (git+https://github.com/fluencelabs/rust-sdk)", ] [[package]] @@ -772,7 +781,7 @@ dependencies = [ "env_logger 0.7.1", "fce", "fce-utils", - "fluence-sdk-main 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "fluence-sdk-main 0.2.9", "itertools", "log", "once_cell", @@ -794,15 +803,23 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca5ffdf0ccf817b1e4e8438f6da7e8fa024679c706a69bde7aa8cad8b43e90ee" dependencies = [ - "fluence-sdk-wit 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "fluence-sdk-wit 0.2.9", ] [[package]] name = "fluence-sdk-macro" -version = "0.2.9" -source = "git+https://github.com/fluencelabs/rust-sdk#fd9672636e8d7a91275e5e0b8b88a34494336e5a" +version = "0.2.10" +source = "git+https://github.com/fluencelabs/rust-sdk?branch=logger_env#be250f9c1f75309b1d96d78dbfd380a8fae7fd3f" dependencies = [ - "fluence-sdk-wit 0.2.9 (git+https://github.com/fluencelabs/rust-sdk)", + "fluence-sdk-wit 0.2.10 (git+https://github.com/fluencelabs/rust-sdk?branch=logger_env)", +] + +[[package]] +name = "fluence-sdk-macro" +version = "0.2.10" +source = "git+https://github.com/fluencelabs/rust-sdk#ebf3e63aef8d4aafda41180eeb299c4138628174" +dependencies = [ + "fluence-sdk-wit 0.2.10 (git+https://github.com/fluencelabs/rust-sdk)", ] [[package]] @@ -811,17 +828,27 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4f81c3778c18d372fec6d96049f25e29fc4ff7ba4ab65ef4c2285f971e8670a" dependencies = [ - "fluence-sdk-macro 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "fluence-sdk-macro 0.2.9", "log", "serde", ] [[package]] name = "fluence-sdk-main" -version = "0.2.9" -source = "git+https://github.com/fluencelabs/rust-sdk#fd9672636e8d7a91275e5e0b8b88a34494336e5a" +version = "0.2.10" +source = "git+https://github.com/fluencelabs/rust-sdk?branch=logger_env#be250f9c1f75309b1d96d78dbfd380a8fae7fd3f" dependencies = [ - "fluence-sdk-macro 0.2.9 (git+https://github.com/fluencelabs/rust-sdk)", + "fluence-sdk-macro 0.2.10 (git+https://github.com/fluencelabs/rust-sdk?branch=logger_env)", + "log", + "serde", +] + +[[package]] +name = "fluence-sdk-main" +version = "0.2.10" +source = "git+https://github.com/fluencelabs/rust-sdk#ebf3e63aef8d4aafda41180eeb299c4138628174" +dependencies = [ + "fluence-sdk-macro 0.2.10 (git+https://github.com/fluencelabs/rust-sdk)", "log", "serde", ] @@ -842,8 +869,21 @@ dependencies = [ [[package]] name = "fluence-sdk-wit" -version = "0.2.9" -source = "git+https://github.com/fluencelabs/rust-sdk#fd9672636e8d7a91275e5e0b8b88a34494336e5a" +version = "0.2.10" +source = "git+https://github.com/fluencelabs/rust-sdk?branch=logger_env#be250f9c1f75309b1d96d78dbfd380a8fae7fd3f" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", + "uuid", +] + +[[package]] +name = "fluence-sdk-wit" +version = "0.2.10" +source = "git+https://github.com/fluencelabs/rust-sdk#ebf3e63aef8d4aafda41180eeb299c4138628174" dependencies = [ "proc-macro2", "quote", @@ -1323,15 +1363,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" +checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" [[package]] name = "local_storage" version = "0.1.0" dependencies = [ - "fluence 0.2.9 (git+https://github.com/fluencelabs/rust-sdk)", + "fluence 0.2.9 (git+https://github.com/fluencelabs/rust-sdk?branch=logger_env)", "log", ] @@ -2096,9 +2136,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" dependencies = [ "serde_derive", ] @@ -2124,9 +2164,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" dependencies = [ "proc-macro2", "quote", @@ -2135,9 +2175,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +checksum = "1500e84d27fe482ed1dc791a56eddc2f230046a040fa908c08bda1d9fb615779" dependencies = [ "itoa", "ryu", @@ -2195,9 +2235,9 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acad6f34eb9e8a259d3283d1e8c1d34d7415943d4895f65cc73813c7396fc85" +checksum = "ae524f056d7d770e174287294f562e95044c68e88dec909a00d2094805db9d75" [[package]] name = "socket2" @@ -2237,9 +2277,9 @@ checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd" [[package]] name = "syn" -version = "1.0.53" +version = "1.0.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8833e20724c24de12bbaba5ad230ea61c3eafb05b881c7c9d3cfe8638b187e68" +checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44" dependencies = [ "proc-macro2", "quote", diff --git a/examples/ipfs-node/effector/src/main.rs b/examples/ipfs-node/effector/src/main.rs index 9840bd36..7ea83fb3 100644 --- a/examples/ipfs-node/effector/src/main.rs +++ b/examples/ipfs-node/effector/src/main.rs @@ -19,14 +19,14 @@ mod path; use crate::path::to_full_path; use fluence::fce; -use fluence::WasmLogger; +use fluence::WasmLoggerBuilder; const RESULT_FILE_PATH: &str = "/tmp/ipfs_rpc_file"; const IPFS_ADDR_ENV_NAME: &str = "IPFS_ADDR"; const TIMEOUT_ENV_NAME: &str = "timeout"; pub fn main() { - WasmLogger::new() + WasmLoggerBuilder::new() .with_log_level(log::Level::Info) .build() .unwrap(); diff --git a/examples/ipfs-node/pure/src/main.rs b/examples/ipfs-node/pure/src/main.rs index 1f248de9..9517cb71 100644 --- a/examples/ipfs-node/pure/src/main.rs +++ b/examples/ipfs-node/pure/src/main.rs @@ -15,7 +15,7 @@ */ use fluence::fce; -use fluence::WasmLogger; +use fluence::WasmLoggerBuilder; use std::fs; use std::path::PathBuf; @@ -23,7 +23,7 @@ use std::path::PathBuf; const RPC_TMP_FILEPATH: &str = "/tmp/ipfs_rpc_file"; pub fn main() { - WasmLogger::new() + WasmLoggerBuilder::new() .with_log_level(log::Level::Info) .build() .unwrap(); diff --git a/examples/url-downloader/artifacts/curl.wasm b/examples/url-downloader/artifacts/curl.wasm index ac80b04fb2833b284902c8526a22dfcb4d65dda5..891948095ca0476c84f862189ce89f32adf4cdab 100755 GIT binary patch delta 771 zcmXYuO=#3W7=~w(Y?AH%O?9Q)V(IKuWGh&*+5Cd&W}#Z?$%A;XT9Ryntf$q|gDowJ zg|>K+fJgOYp(xbm5HF%PrFzg>1fhD;W5rr;Ui@||bC`GLd*_*VzInPQtnCTw>pcDx zKj&XuT6idPxdm~47&*Vtb;cb-4l46py)!7TaEJ*Gs&Gp?^@$v!TmzZBOtB-hpj1wQ zlDkTzobv&-m_!lmjPQsR8vC0c->u&JvhfEknmn9!-hx4FDR>2|h)|=+xv$zXX&;MjB+95}Jm^93zXYm&(!n7QY;BTrNL2F#>0 zmwPBgB`i&)cDa+J)XgS?Dt1+dtMi?AWvJAuAjGn?CtAJ20+E8}n#0e)K25h-&Jm_t zEMMV-bMWXC1%+7tY>w+_Dw3J89G3y=LW`m{L$J!COa>s`gV2C7%7TH1HZlHyS(c*F zt6P22L0^F?kqzu%Fk(m(^-UeeLVS8EF5We-v&1Nc&OrBwe$8tFG zmm7ef+*l4pYs^V7CWvdIKH!DkLL@h`*r_6E`GBWVO)wYZ$IkAmH6+E z;vmrs)iMLuu#Ku^hh~rr@pynIw&v@$p;WcdHfp-BCg(*wn<92#1csuzdb8%MZp}@$ zGx)Jce9y2I%kXv2cHO|UlDmiS97jSsbWKySZNm>t)d&-E1P}4V@SCBh=$hVi0cM8D znG$9k33NLQb-&rHSxv(;&7?hmFK|S&6w6gy!>R^wdreEWj^b*^?P{LyTDA&kSF0t5 phj2Yl6wlLr3yQAhYMN>#{z-gGB$fd|j4H5I9pb3TZVkT@{s9=FxV-=X delta 756 zcmX9*J!lj`6rP#g+uP)RoP?9)LSp8|5H5wVd%Lr{QwX;QF_GBVD3WN{o4ZBMLZTss zMuU<-l1>&(BbY`(QHXA_>8w-`ix6U`Rqnqr!^z@GS8EfLj!e0aQ;9fmH;kLO>N&X9|Fz25=RfKws_1hl(nZ-bERL z{5{a2TC_V$hO^{UfDb@nqOX`Szliy**h}gG*)_2Gnnc`Tc~IRNX^tqR-#fD_4=Ta zLvXaN#B@zKzyihsUu>PRm@OAtaQaD+Fa<7Vms?pp=LvB{~jb3a#imq%@ zEhW8#(b%RDuWWkLdD$WTqwWvIANL~&%ki~?=Y7zK|NSbBVD8jR+jcp(0weT9kc=pB zNWq@LxFuTLt2sh6IZviEct3+JwDot0jBG&_vh^f*Kc2=$MR!9t)DbQCKfxw`RL$$X&C=EpA#O3C_WL iTFGIpW+1rh8Z7l~On!#bTiYfywhRqslW`las{aADVy-U$ diff --git a/examples/url-downloader/artifacts/facade.wasm b/examples/url-downloader/artifacts/facade.wasm index e285e94bbd21b8e608d60865df28f560346f1824..2dfa456e7d568532e0814a008f665186ccbaa7db 100755 GIT binary patch delta 4118 zcma)9eQZ=Vv>%lLrI{2_e@n0i1>pC$XRHQot{3C~5eRKvmm8%bYJ&hINEd zKqbZLmj;MwthXC%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ZvxiQQm(MBRY{Er+?{ z;ynnxlMFhaLzdh4H8DvS1|<>I5#+x=9Bw{4oieFK7zNTnGYa?N6Rr>}6(WN4EMIse z$L%AgE@Zq#_%lZuE5%zFoo%+Kk33W1Ey7K)FTu?s-~I9yQnU*%|J_}45LRojL$#_l z#OOi$r?3Cnv+J9yuv9kZ9iy-oZ4$x50uAvhRx(XE2lV3%W#|-m2{XJ|;}{7L5i~Ra z`wwsBD%J}bNQsmIoR_4S6v>jDZv42jMq5BCz-yT%EXyEE&-sCOmVJ9_dR#GnAoQXv zOL~Li5oC*T2Fe2nK#JJ3al#rRHVdg-ERw{^Z*mrbG8>-R|9U4}vHgmW;&fZIKXH<# z{kPO|gY>Es)*!`IpzJ(o;mr_2D<(F~0_kvGowjp@a~gTWPMy3!{bRF8F5vU#?6@NQ zlmwP;d(G)Dynx{9i3y6f_1U@i$x_+BOC1S)zDtZQfv8#j(d1V0yuIdw%fyS|iC!T) zh28SuYlQgi)93RGNXTCI&$W$4GS<-^iNur1aBnD+NcR?AP)VI?Btp?-INhI2bi~r> zzGSjc&`I89gya3`foP^blgUJ*eerZ*gO|Li8_`66q@y?98-=K7|3F{i(}iS^)(u1> zp>R4JOGXoY?TK)#YqS2y{(TP(?A`KOpqBUxzg$c{r$%HTnoh?0GJVNND3KV57k=X> zCS910L31RWh-cEtL^>Ys+Wp$>QqomeRZps@k&Lv*L+MO7l!?aL)6tH?U5%uj8j0TC zj$}HPiM20~?}iVAN+ Lh3`ekI`{toVc%(U diff --git a/examples/url-downloader/artifacts/local_storage.wasm b/examples/url-downloader/artifacts/local_storage.wasm index b9c8d205451841a1e4920c352b23d944e367c188..47729cf01dc0049238e1fd896bac35dd9bc533b2 100755 GIT binary patch delta 18819 zcma)k3t&{m)&D*B?rt`@3Asslge1V-C6ELXvU%+$2$+e4hdf0QUp0h0kjOIx6;u{0 zK8uQudbOgWq9UTAK|uwLii!#r6e}vNu||unR=Ne`oG)0%-g7>*vm#nKLuz zJ!fVvIkM6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&Bi| zT-aD=e_Tps@%3KV3KpDY_YYA$&9-j|QQ6=*r~j;e?l1lZzu}jEf`6q#IIX0PEjlafQtNxP#zq5ZFMpw|a_T^^*+3W0Sg0j-eOA5mUwX=!~W|f8t zYfFo&R@ev6qFH+6I{ToYE9``PN(_}2mKDq@u7{LM>dMOtLsiX`5Myz5}N;NxU|CB zlDe7og>^NvW)&5O3uadR!M<@MB(U09^`ntk^)~yPkyJ!$?7%3f?(Oy^qo{<|+Ru%r zD*K&Ll$CM^LE#y1h4r1btAd^+>8$X61y)$+)Ds2jcRBTuT)&&^g=E_|Ag-nL_N#)f z$@wFBVLdgCO@AVv!g}Gt`S(zga(4A~&K~#LcrtT|@6U88Y%f%7FRDb)&{0Vhw873E zP3O^l_U&U~EANb^UbNBvW;Cug_Y=#y#y&g-Lf&M5J_c^`fnB*(gwS`h{pck4uj|GF zslV{lrI`;>uP$a)zhKGI#?vOX#rBVbEpD~18wXq5w(FH~)Pv}uUF~PX&AT6_X0pE< z4eOmco(9l%XYHNivGya(wL02i512s1(soiZ_{M^X3cST`oB-eTsJ(LnUFdp@X4;Pi z;K`;;BqJ?cR1z+nRUR&^D=#iDEUv9;wdYNQ7Cvrood|(FVShZ4rqPpj$t1{Xm$T=6 zld$JgTt7$O4f5I5kDiRSr|t76(_&N*DjtyLqpG!r@Cs{+@^gL zUtK+~wyCjZ!IHMq7)L|I=VB@wg`cP3z9i)z5qSqmGh>#@xNN>%)xU(L2wUE8#HPW2kHAP3pFcR4;=6}R>t@!}mWRUyrF`xcRK0`KWA9WPn8E3k aLGRjPI!&ba94+249he>6)i#~N?*9)F>QDUu diff --git a/examples/url-downloader/curl/src/main.rs b/examples/url-downloader/curl/src/main.rs index 76731328..7e5b0879 100644 --- a/examples/url-downloader/curl/src/main.rs +++ b/examples/url-downloader/curl/src/main.rs @@ -15,14 +15,11 @@ */ use fluence::fce; -use fluence::WasmLogger; +use fluence::WasmLoggerBuilder; /// Log level can be changed by `RUST_LOG` env as well. pub fn main() { - WasmLogger::new() - .with_log_level(log::Level::Info) - .build() - .unwrap(); + WasmLoggerBuilder::new().build().unwrap(); } #[fce] diff --git a/examples/url-downloader/facade/src/main.rs b/examples/url-downloader/facade/src/main.rs index f0fd278c..953c15f5 100644 --- a/examples/url-downloader/facade/src/main.rs +++ b/examples/url-downloader/facade/src/main.rs @@ -15,13 +15,10 @@ */ use fluence::fce; -use fluence::WasmLogger; +use fluence::WasmLoggerBuilder; pub fn main() { - WasmLogger::new() - .with_log_level(log::Level::Info) - .build() - .unwrap(); + WasmLoggerBuilder::new().build().unwrap(); } /// Combining of modules: `curl` and `local_storage`. diff --git a/examples/url-downloader/local_storage/Cargo.toml b/examples/url-downloader/local_storage/Cargo.toml index 8c04809e..f352e4f5 100644 --- a/examples/url-downloader/local_storage/Cargo.toml +++ b/examples/url-downloader/local_storage/Cargo.toml @@ -9,5 +9,5 @@ name = "local_storage" path = "src/main.rs" [dependencies] -fluence = { git = "https://github.com/fluencelabs/rust-sdk", features = ["logger"] } +fluence = { git = "https://github.com/fluencelabs/rust-sdk", features = ["logger"], branch = "logger_env" } log = "0.4.8" diff --git a/examples/url-downloader/local_storage/src/main.rs b/examples/url-downloader/local_storage/src/main.rs index edee10e0..9b45be27 100644 --- a/examples/url-downloader/local_storage/src/main.rs +++ b/examples/url-downloader/local_storage/src/main.rs @@ -16,17 +16,14 @@ use std::fs; use fluence::fce; -use fluence::WasmLogger; +use fluence::WasmLoggerBuilder; use std::path::PathBuf; const SITES_DIR: &str = "/sites/"; /// Log level can be changed by `RUST_LOG` env as well. pub fn main() { - WasmLogger::new() - .with_log_level(log::Level::Info) - .build() - .unwrap(); + WasmLoggerBuilder::new().build().unwrap(); } /// You can read or write files from the file system if there is permission to use directories described in `Config.toml`. @@ -46,7 +43,7 @@ pub fn put(name: String, file_content: Vec) -> String { #[fce] pub fn get(file_name: String) -> Vec { - log::info!("get called with file name: {}", file_name); + log::debug!("get called with file name: {}", file_name); let tmp_filepath = format!("{}{}", SITES_DIR, file_name); diff --git a/fluence-faas/src/faas.rs b/fluence-faas/src/faas.rs index e70837e5..4b383ee7 100644 --- a/fluence-faas/src/faas.rs +++ b/fluence-faas/src/faas.rs @@ -22,6 +22,8 @@ use crate::IValue; use crate::IType; use crate::misc::load_modules_from_fs; use crate::misc::ModulesLoadStrategy; +use crate::logger::LoggerFilter; +use crate::logger::WASM_LOG_ENV_NAME; use fce::FCE; use fce::IFunctionArg; @@ -91,6 +93,11 @@ impl FluenceFaaS { let call_parameters = Rc::new(RefCell::new(<_>::default())); let modules_dir = config.modules_dir; + + // LoggerFilter can be initialized with an empty string + let wasm_log_env = std::env::var(WASM_LOG_ENV_NAME).unwrap_or_default(); + let logger_filter = LoggerFilter::from_env_string(&wasm_log_env); + for (module_name, module_config) in config.modules_config { let module_bytes = modules.remove(&module_name).ok_or_else(|| { @@ -104,6 +111,7 @@ impl FluenceFaaS { module_name.clone(), Some(module_config), call_parameters.clone(), + &logger_filter )?; fce.load_module(module_name, &module_bytes, fce_module_config)?; } diff --git a/fluence-faas/src/lib.rs b/fluence-faas/src/lib.rs index 795918fb..69481e3d 100644 --- a/fluence-faas/src/lib.rs +++ b/fluence-faas/src/lib.rs @@ -26,6 +26,7 @@ mod config; mod errors; +mod logger; mod faas; mod faas_interface; mod misc; diff --git a/fluence-faas/src/misc/log_utf8_string_impl.rs b/fluence-faas/src/logger/log_utf8_string_impl.rs similarity index 96% rename from fluence-faas/src/misc/log_utf8_string_impl.rs rename to fluence-faas/src/logger/log_utf8_string_impl.rs index 5299d826..02b992c8 100644 --- a/fluence-faas/src/misc/log_utf8_string_impl.rs +++ b/fluence-faas/src/logger/log_utf8_string_impl.rs @@ -17,7 +17,7 @@ use wasmer_core::vm::Ctx; use wasmer_core::memory::ptr::{Array, WasmPtr}; -pub(super) fn log_utf8_string_closure( +pub(crate) fn log_utf8_string_closure( logging_mask: i64, module: String, ) -> impl Fn(&mut Ctx, i32, i64, i32, i32) { @@ -28,7 +28,7 @@ pub(super) fn log_utf8_string_closure( } } -pub(super) fn log_utf8_string( +pub(crate) fn log_utf8_string( module: &str, ctx: &mut Ctx, level: i32, diff --git a/fluence-faas/src/logger/logger_filter.rs b/fluence-faas/src/logger/logger_filter.rs new file mode 100644 index 00000000..c24e1abd --- /dev/null +++ b/fluence-faas/src/logger/logger_filter.rs @@ -0,0 +1,102 @@ +/* + * Copyright 2020 Fluence Labs Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +use log::LevelFilter; +use std::collections::HashMap; + +/// A logger filter. +/// +/// This struct can be used to determine whether or not +/// a log record should be written to the output. +#[derive(Clone, Default, Eq, PartialEq, Debug)] +pub(crate) struct LoggerFilter<'env_string> { + default_log_level: Option, + module_levels: HashMap<&'env_string str, LevelFilter>, +} + +impl<'env_string> LoggerFilter<'env_string> { + /// Parses a content of supplied variable in form of "module_name_1=log_level,module_name_2". + pub(crate) fn from_env_string(env: &'env_string str) -> Self { + let mut module_levels = HashMap::new(); + let mut default_log_level: Option = None; + + for module_log in env.split(',') { + if module_log.is_empty() { + continue; + } + + let mut module_log_parts = module_log.split('='); + let part_0 = module_log_parts.next(); + let part_1 = module_log_parts.next().map(|s| s.trim()); + if let Some(part_3) = module_log_parts.next() { + eprintln!( + "logger warning: invalid directive '{}', ignoring it", + part_3 + ); + continue; + } + let (module_name, module_log_level) = match (part_0, part_1) { + // "info" + // "1" + (Some(part), None) => match part.parse() { + Ok(num) => (None, num), + Err(_) => (Some(part), LevelFilter::max()), + }, + // "module_name=" + (Some(module_name), Some("")) => (Some(module_name), LevelFilter::max()), + // "module_name=info" + (Some(module_name), Some(log_level)) => match log_level.parse() { + Ok(log_level) => (Some(module_name), log_level), + Err(e) => { + eprintln!( + "logger warning: invalid directive '{}', error '{}', ignoring it", + log_level, e + ); + continue; + } + }, + d => { + eprintln!("logger warning: invalid directive '{:?}', ignoring it", d); + continue; + } + }; + + match (module_name, &mut default_log_level) { + (Some(module_name), _) => { + module_levels.insert(module_name, module_log_level); + } + (None, Some(_)) => { + eprintln!( + "logger warning: can't set default level twice, '{}' ignored", + module_log_level + ); + } + (None, w) => *w = Some(module_log_level), + } + } + + Self { + default_log_level, + module_levels, + } + } + + pub(crate) fn module_level(&self, module_name: &str) -> Option { + self.module_levels + .get(module_name) + .map_or_else(|| self.default_log_level, |l| Some(*l)) + } +} diff --git a/fluence-faas/src/logger/mod.rs b/fluence-faas/src/logger/mod.rs new file mode 100644 index 00000000..76b04a9f --- /dev/null +++ b/fluence-faas/src/logger/mod.rs @@ -0,0 +1,23 @@ +/* + * Copyright 2020 Fluence Labs Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +mod logger_filter; +mod log_utf8_string_impl; + +pub const WASM_LOG_ENV_NAME: &str = "WASM_LOG"; + +pub(crate) use logger_filter::LoggerFilter; +pub(crate) use log_utf8_string_impl::log_utf8_string_closure; diff --git a/fluence-faas/src/misc/mod.rs b/fluence-faas/src/misc/mod.rs index c12b7943..dfdaaa49 100644 --- a/fluence-faas/src/misc/mod.rs +++ b/fluence-faas/src/misc/mod.rs @@ -16,7 +16,6 @@ mod ivalues_to_json; mod json_to_ivalues; -mod log_utf8_string_impl; mod modules_load_strategy; mod utils; @@ -26,5 +25,3 @@ pub(crate) use modules_load_strategy::ModulesLoadStrategy; pub(crate) use utils::create_host_import; pub(crate) use utils::make_fce_config; pub(crate) use utils::load_modules_from_fs; - -pub(self) use log_utf8_string_impl::log_utf8_string_closure; diff --git a/fluence-faas/src/misc/utils.rs b/fluence-faas/src/misc/utils.rs index 6b7cd377..5e8df2a0 100644 --- a/fluence-faas/src/misc/utils.rs +++ b/fluence-faas/src/misc/utils.rs @@ -14,10 +14,12 @@ * limitations under the License. */ -use super::log_utf8_string_closure; use crate::Result; use crate::config::FaaSModuleConfig; use crate::errors::FaaSError; +use crate::logger::log_utf8_string_closure; +use crate::logger::LoggerFilter; +use crate::logger::WASM_LOG_ENV_NAME; use fce::FCEModuleConfig; use fce::HostImportDescriptor; @@ -83,6 +85,7 @@ pub(crate) fn make_fce_config( module_name: String, faas_module_config: Option, call_parameters: Rc>, + logger_filter: &LoggerFilter<'_> ) -> Result { let mut fce_module_config = FCEModuleConfig::default(); @@ -123,6 +126,20 @@ pub(crate) fn make_fce_config( let mut namespace = Namespace::new(); if faas_module_config.logger_enabled { + if let Some(level_filter) = logger_filter.module_level(&module_name) { + let log_level = level_filter.to_level(); + let log_level_str = match log_level { + Some(log_level) => log_level.to_string(), + None => String::from("off") + }; + + // overwrite possibly installed log variable in config + fce_module_config.wasi_envs.insert( + WASM_LOG_ENV_NAME.as_bytes().to_owned(), + log_level_str.into_bytes(), + ); + } + let logging_mask = faas_module_config.logging_mask; namespace.insert( "log_utf8_string", @@ -190,3 +207,4 @@ pub(crate) fn load_modules_from_fs( Ok(loaded) } +