tracing-worker

Crates.iotracing-worker
lib.rstracing-worker
version0.1.9
sourcesrc
created_at2023-04-06 07:37:48.098265
updated_at2023-04-06 09:26:52.846722
descriptiontracing-subscriber implementation for Cloudflare Workers worker crate
homepage
repositoryhttps://github.com/psarna/tracing-worker
max_upload_size
id831986
size15,734
Piotr Sarna (psarna)

documentation

README

tracing-worker

tracing_subscriber implementation for Cloudflare Workers' workers.rs crate.

This is an independent open-source implementation, not affiliated with Cloudflare.

Add as a dependency

cargo add tracing-worker

Initialize

pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> Result<Response> {
    tracing_worker::init(&env);
    (...)

Tracing records will now be printed to the console:

$ wrangler dev
Thu Apr 06 2023 09:24:09 GMT+0000  INFO country_counter: [/], located at: (52.2296, 21.0067), within: Mazovia (event src/lib.rs:10)
Thu Apr 06 2023 09:24:09 GMT+0000 DEBUG libsql_client::workers: Stream opened (event /home/sarna/.cargo/registry/src/github.com-1ecc6299db9ec823/libsql-client-0.22.3/src/workers.rs:78)
Commit count: 12

cargo fmt