@@ -529,6 +529,28 @@ pub mod wavs {
529529 . finish ( )
530530 }
531531 }
532+ #[ derive( Clone , Copy ) ]
533+ pub enum LogLevel {
534+ Error ,
535+ Warn ,
536+ Info ,
537+ Debug ,
538+ Trace ,
539+ }
540+ impl :: core:: fmt:: Debug for LogLevel {
541+ fn fmt (
542+ & self ,
543+ f : & mut :: core:: fmt:: Formatter < ' _ > ,
544+ ) -> :: core:: fmt:: Result {
545+ match self {
546+ LogLevel :: Error => f. debug_tuple ( "LogLevel::Error" ) . finish ( ) ,
547+ LogLevel :: Warn => f. debug_tuple ( "LogLevel::Warn" ) . finish ( ) ,
548+ LogLevel :: Info => f. debug_tuple ( "LogLevel::Info" ) . finish ( ) ,
549+ LogLevel :: Debug => f. debug_tuple ( "LogLevel::Debug" ) . finish ( ) ,
550+ LogLevel :: Trace => f. debug_tuple ( "LogLevel::Trace" ) . finish ( ) ,
551+ }
552+ }
553+ }
532554 }
533555 }
534556}
@@ -540,6 +562,7 @@ pub mod host {
540562 use super :: _rt;
541563 pub type EthChainConfig = super :: wavs:: worker:: layer_types:: EthChainConfig ;
542564 pub type CosmosChainConfig = super :: wavs:: worker:: layer_types:: CosmosChainConfig ;
565+ pub type LogLevel = super :: wavs:: worker:: layer_types:: LogLevel ;
543566 #[ allow( unused_unsafe, clippy:: all) ]
544567 pub fn get_eth_chain_config ( chain_name : & str ) -> Option < EthChainConfig > {
545568 unsafe {
@@ -727,6 +750,33 @@ pub mod host {
727750 }
728751 }
729752 }
753+ #[ allow( unused_unsafe, clippy:: all) ]
754+ pub fn log ( level : LogLevel , message : & str ) {
755+ unsafe {
756+ use super :: wavs:: worker:: layer_types:: LogLevel as V0 ;
757+ let result1 = match level {
758+ V0 :: Error => 0i32 ,
759+ V0 :: Warn => 1i32 ,
760+ V0 :: Info => 2i32 ,
761+ V0 :: Debug => 3i32 ,
762+ V0 :: Trace => 4i32 ,
763+ } ;
764+ let vec2 = message;
765+ let ptr2 = vec2. as_ptr ( ) . cast :: < u8 > ( ) ;
766+ let len2 = vec2. len ( ) ;
767+ #[ cfg( target_arch = "wasm32" ) ]
768+ #[ link( wasm_import_module = "host" ) ]
769+ extern "C" {
770+ #[ link_name = "log" ]
771+ fn wit_import ( _: i32 , _: * mut u8 , _: usize ) ;
772+ }
773+ #[ cfg( not( target_arch = "wasm32" ) ) ]
774+ fn wit_import ( _: i32 , _: * mut u8 , _: usize ) {
775+ unreachable ! ( )
776+ }
777+ wit_import ( result1, ptr2. cast_mut ( ) , len2) ;
778+ }
779+ }
730780}
731781mod _rt {
732782 pub use alloc_crate:: string:: String ;
@@ -789,11 +839,11 @@ macro_rules! __export_layer_trigger_world_impl {
789839#[ doc( inline) ]
790840pub ( crate ) use __export_layer_trigger_world_impl as export;
791841#[ cfg( target_arch = "wasm32" ) ]
792- #[ link_section = "component-type:wit-bindgen:0.35.0:wavs:worker@0.3.0-alpha1 :layer-trigger-world:encoded world" ]
842+ #[ link_section = "component-type:wit-bindgen:0.35.0:wavs:worker@0.3.0-alpha2 :layer-trigger-world:encoded world" ]
793843#[ doc( hidden) ]
794- pub static __WIT_BINDGEN_COMPONENT_TYPE: [ u8 ; 1472 ] = * b"\
795- \0 asm\x0d \0 \x01 \0 \0 \x19 \x16 wit-component-encoding\x04 \0 \x07 \xb6 \x0a \x01 A\x02 \x01 \
796- A\x0c \x01 B! \x01 r\x02 \x0b bech32-addrs\x0a prefix-leny\x04 \0 \x0e cosmos-address\x03 \0 \
844+ pub static __WIT_BINDGEN_COMPONENT_TYPE: [ u8 ; 1591 ] = * b"\
845+ \0 asm\x0d \0 \x01 \0 \0 \x19 \x16 wit-component-encoding\x04 \0 \x07 \xad \x0b \x01 A\x02 \x01 \
846+ A\x0d \x01 B# \x01 r\x02 \x0b bech32-addrs\x0a prefix-leny\x04 \0 \x0e cosmos-address\x03 \0 \
797847\0 \x01 o\x02 ss\x01 p\x02 \x01 r\x02 \x02 tys\x0a attributes\x03 \x04 \0 \x0c cosmos-event\x03 \
798848\0 \x04 \x01 ks\x01 r\x07 \x08 chain-ids\x0c rpc-endpoint\x06 \x0d grpc-endpoint\x06 \x11 g\
799849 rpc-web-endpoint\x06 \x09 gas-pricev\x09 gas-denoms\x0d bech32-prefixs\x04 \0 \x13 cosm\
@@ -811,16 +861,19 @@ ontract-event\x03\0\x19\x01r\x04\x10contract-address\x01\x0achain-names\x05event
811861\x05 \x0c block-heightw\x04 \0 \" trigger-data-cosmos-contract-event\x03 \0 \x1b \x01 q\x03 \
812862\x12 eth-contract-event\x01 \x1a \0 \x15 cosmos-contract-event\x01 \x1c \0 \x03 raw\x01 \x09 \
813863\0 \x04 \0 \x0c trigger-data\x03 \0 \x1d \x01 r\x02 \x06 config\x18 \x04 data\x1e \x04 \0 \x0e t\
814- rigger-action\x03 \0 \x1f \x03 \0 $wavs:worker/layer-types@0.3.0-alpha1\x05 \0 \x02 \x03 \
815- \0 \0 \x0e trigger-action\x03 \0 \x0e trigger-action\x03 \0 \x01 \x02 \x03 \0 \0 \x10 eth-chai\
816- n-config\x02 \x03 \0 \0 \x13 cosmos-chain-config\x01 B\x0a \x02 \x03 \x02 \x01 \x03 \x04 \0 \x10 \
817- eth-chain-config\x03 \0 \0 \x02 \x03 \x02 \x01 \x04 \x04 \0 \x13 cosmos-chain-config\x03 \0 \x02 \
818- \x01 k\x01 \x01 @\x01 \x0a chain-names\0 \x04 \x04 \0 \x14 get-eth-chain-config\x01 \x05 \x01 \
819- k\x03 \x01 @\x01 \x0a chain-names\0 \x06 \x04 \0 \x17 get-cosmos-chain-config\x01 \x07 \x03 \
820- \0 \x04 host\x05 \x05 \x01 p}\x01 j\x01 \x06 \x01 s\x01 @\x01 \x0e trigger-action\x02 \0 \x07 \x04 \
821- \0 \x03 run\x01 \x08 \x04 \0 ,wavs:worker/layer-trigger-world@0.3.0-alpha1\x04 \0 \x0b \x19 \
822- \x01 \0 \x13 layer-trigger-world\x03 \0 \0 \0 G\x09 producers\x01 \x0c processed-by\x02 \x0d \
823- wit-component\x07 0.220.0\x10 wit-bindgen-rust\x06 0.35.0";
864+ rigger-action\x03 \0 \x1f \x01 q\x05 \x05 error\0 \0 \x04 warn\0 \0 \x04 info\0 \0 \x05 debug\0 \
865+ \0 \x05 trace\0 \0 \x04 \0 \x09 log-level\x03 \0 !\x03 \0 $wavs:worker/layer-types@0.3.0-al\
866+ pha2\x05 \0 \x02 \x03 \0 \0 \x0e trigger-action\x03 \0 \x0e trigger-action\x03 \0 \x01 \x02 \x03 \
867+ \0 \0 \x10 eth-chain-config\x02 \x03 \0 \0 \x13 cosmos-chain-config\x02 \x03 \0 \0 \x09 log-l\
868+ evel\x01 B\x0e \x02 \x03 \x02 \x01 \x03 \x04 \0 \x10 eth-chain-config\x03 \0 \0 \x02 \x03 \x02 \x01 \
869+ \x04 \x04 \0 \x13 cosmos-chain-config\x03 \0 \x02 \x02 \x03 \x02 \x01 \x05 \x04 \0 \x09 log-lev\
870+ el\x03 \0 \x04 \x01 k\x01 \x01 @\x01 \x0a chain-names\0 \x06 \x04 \0 \x14 get-eth-chain-confi\
871+ g\x01 \x07 \x01 k\x03 \x01 @\x01 \x0a chain-names\0 \x08 \x04 \0 \x17 get-cosmos-chain-confi\
872+ g\x01 \x09 \x01 @\x02 \x05 level\x05 \x07 messages\x01 \0 \x04 \0 \x03 log\x01 \x0a \x03 \0 \x04 \
873+ host\x05 \x06 \x01 p}\x01 j\x01 \x07 \x01 s\x01 @\x01 \x0e trigger-action\x02 \0 \x08 \x04 \0 \x03 \
874+ run\x01 \x09 \x04 \0 ,wavs:worker/layer-trigger-world@0.3.0-alpha2\x04 \0 \x0b \x19 \x01 \
875+ \0 \x13 layer-trigger-world\x03 \0 \0 \0 G\x09 producers\x01 \x0c processed-by\x02 \x0d wit\
876+ -component\x07 0.220.0\x10 wit-bindgen-rust\x06 0.35.0";
824877#[ inline( never) ]
825878#[ doc( hidden) ]
826879pub fn __link_custom_section_describing_imports ( ) {
0 commit comments