{"id":16593867,"url":"https://github.com/worldsender/tracing-web","last_synced_at":"2025-03-16T21:30:37.752Z","repository":{"id":56854157,"uuid":"526404673","full_name":"WorldSEnder/tracing-web","owner":"WorldSEnder","description":"A tracing subscriber for the web","archived":false,"fork":false,"pushed_at":"2023-11-30T09:43:32.000Z","size":25,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T14:30:12.173Z","etag":null,"topics":["debugging-tool","logging","webassembly"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/tracing-web","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WorldSEnder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-18T23:40:33.000Z","updated_at":"2024-12-12T00:32:08.000Z","dependencies_parsed_at":"2022-09-06T09:22:37.532Z","dependency_job_id":null,"html_url":"https://github.com/WorldSEnder/tracing-web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WorldSEnder%2Ftracing-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WorldSEnder%2Ftracing-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WorldSEnder%2Ftracing-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WorldSEnder%2Ftracing-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WorldSEnder","download_url":"https://codeload.github.com/WorldSEnder/tracing-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830915,"owners_count":20354850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging-tool","logging","webassembly"],"created_at":"2024-10-11T23:44:22.986Z","updated_at":"2025-03-16T21:30:37.440Z","avatar_url":"https://github.com/WorldSEnder.png","language":"Rust","readme":"##  tracing-web\n\nA [`tracing`] compatible subscriber layer for web platforms.\n\n[![Crates.io][crates-badge]][crates-url]\n[![Documentation][docs-badge]][docs-url]\n[![MIT licensed][mit-badge]][mit-url]\n[![Apache licensed][apache-badge]][apache-url]\n\n[Documentation][docs-url]\n\n[`tracing`]: https://crates.io/crates/tracing\n[crates-badge]: https://img.shields.io/crates/v/tracing-web.svg\n[crates-url]: https://crates.io/crates/tracing-web\n[docs-badge]: https://docs.rs/tracing-web/badge.svg\n[docs-url]: https://docs.rs/tracing-web\n[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[mit-url]: LICENSE-MIT\n[apache-badge]: https://img.shields.io/badge/license-Apache-blue.svg\n[apache-url]: LICENSE-APACHE\n\n# Overview\n\n`tracing-web` can be used in conjunction with the [`tracing-subscriber`] crate to quickly install a\nsubscriber that emits messages to the dev-tools console, and events to the [Performance API]. An example\nconfiguration can look like\n\n```rust\nuse tracing_web::{MakeWebConsoleWriter, performance_layer};\nuse tracing_subscriber::fmt::format::Pretty;\nuse tracing_subscriber::prelude::*;\n\nfn main() {\n    let fmt_layer = tracing_subscriber::fmt::layer()\n        .with_ansi(false) // Only partially supported across browsers\n        .without_time()   // std::time is not available in browsers, see note below\n        .with_writer(MakeWebConsoleWriter::new()); // write events to the console\n    let perf_layer = performance_layer()\n        .with_details_from_fields(Pretty::default());\n\n    tracing_subscriber::registry()\n        .with(fmt_layer)\n        .with(perf_layer)\n        .init(); // Install these as subscribers to tracing events\n\n    todo!(\"write your awesome application\");\n}\n```\n\nNote: You can alternatively use `.with_timer(UtcTime::rfc_3339())` with [`UtcTime`] on `web` targets if you enable\nthe `wasm-bindgen` feature of the `time` crate, for example by adding the following to your `Cargo.toml`.\n\n```toml\ntime = { version = \"0.3\", features = [\"wasm-bindgen\"] }\n```\n\n[`tracing-subscriber`]: https://crates.io/crates/tracing-subscriber\n[Performance API]: https://developer.mozilla.org/en-US/docs/Web/API/Performance\n[`UtcTime`]: https://docs.rs/tracing-subscriber/0.3.18/tracing_subscriber/fmt/time/struct.UtcTime.html\n\n# License\n\nThis project is dual licensed under the [MIT license] and the [Apache license].\n\n[MIT license]: LICENSE-MIT\n[Apache license]: LICENSE-APACHE\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldsender%2Ftracing-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworldsender%2Ftracing-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldsender%2Ftracing-web/lists"}