#flows #logging #slack #platform #flow #message #flowsnet

flowsnet-platform-sdk

Platform SDK for flows.network

7 releases

0.1.6 Oct 9, 2023
0.1.5 Jun 8, 2023
0.1.4 Apr 26, 2023
0.1.2 Mar 2, 2023
0.1.1 Feb 14, 2023

#316 in Debugging

Download history 190/week @ 2024-07-26 320/week @ 2024-08-02 280/week @ 2024-08-09 160/week @ 2024-08-16 115/week @ 2024-08-23 134/week @ 2024-08-30 184/week @ 2024-09-06 218/week @ 2024-09-13 179/week @ 2024-09-20 191/week @ 2024-09-27 115/week @ 2024-10-04 105/week @ 2024-10-11 138/week @ 2024-10-18 143/week @ 2024-10-25 197/week @ 2024-11-01 47/week @ 2024-11-08

551 downloads per month
Used in 4 crates

MIT/Apache

5KB
50 lines

This is a rust logging implementation for flows.network.

Usage example

use slack_flows::{listen_to_channel, send_message_to_channel};
use flowsnet_platform_sdk::logger;

#[no_mangle]
pub fn run() {
    logger::init();
    listen_to_channel("myworkspace", "mychannel", |sm| {
        log::info!("Message received");
        send_message_to_channel("myworkspace", "mychannel", format!("Hello, {}", sm.text))
    }).await;
}

Logging is controlled via the RUST_LOG environment variable. It can be set in the 'Setting' tab in your flow's page. Values should be one of the log levels, they are error, warn, info, debug, trace. For the above example, it should be set to info, debug or trace to make the message be printed. Without RUST_LOG being set, only the error log will be printed. You can see the messages in the 'Running log' tab in you flow's page.

The whole document is here.

Dependencies

~3–4.5MB
~75K SLoC