{"id":51656227,"url":"https://github.com/containerscrew/tiny-tracing","last_synced_at":"2026-07-14T09:31:04.597Z","repository":{"id":292728923,"uuid":"981739850","full_name":"containerscrew/tiny-tracing","owner":"containerscrew","description":"Simple rusty log library (tracing-subscriber wrapper)","archived":false,"fork":false,"pushed_at":"2026-07-06T13:30:26.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-07-06T15:13:18.521Z","etag":null,"topics":["builder-pattern","env-filter","json-logger","logger","logging","observability","rust","rust-crate","structured-logging","tracing","tracing-subscriber"],"latest_commit_sha":null,"homepage":"https://docs.rs/tiny-tracing","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/containerscrew.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-05-11T19:30:08.000Z","updated_at":"2026-07-06T13:30:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"83d221a2-f092-4526-b507-ab01feba440f","html_url":"https://github.com/containerscrew/tiny-tracing","commit_stats":null,"previous_names":["containerscrew/slog-rs","containerscrew/tiny-tracing"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/containerscrew/tiny-tracing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Ftiny-tracing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Ftiny-tracing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Ftiny-tracing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Ftiny-tracing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/containerscrew","download_url":"https://codeload.github.com/containerscrew/tiny-tracing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Ftiny-tracing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35455830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-14T02:00:06.603Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["builder-pattern","env-filter","json-logger","logger","logging","observability","rust","rust-crate","structured-logging","tracing","tracing-subscriber"],"created_at":"2026-07-14T09:31:03.281Z","updated_at":"2026-07-14T09:31:04.591Z","avatar_url":"https://github.com/containerscrew.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tiny-tracing\n\nA lightweight, builder-style logging library for Rust that wraps `tracing` and\n`tracing-subscriber`. Designed for small to medium projects that want structured or\nplain-text output with zero fuss.\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/containerscrew/tiny-tracing/actions/workflows/test.yml\"\u003e\u003cimg alt=\"CI\" src=\"https://img.shields.io/github/actions/workflow/status/containerscrew/tiny-tracing/test.yml?branch=main\u0026label=CI\"\u003e\u003c/a\u003e\n    \u003ca href=\"./CHANGELOG.md\"\u003e\u003cimg alt=\"Changelog\" src=\"https://img.shields.io/badge/changelog-md-blue\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/tiny-tracing\"\u003e\u003cimg alt=\"Crates.io Version\" src=\"https://img.shields.io/crates/v/tiny-tracing\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/tiny-tracing\"\u003e\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/docsrs/tiny-tracing\"\u003e\u003c/a\u003e\n    \u003cimg alt=\"Crates.io Total Downloads\" src=\"https://img.shields.io/crates/d/tiny-tracing?label=crates.io%20downloads\"\u003e\n    \u003cimg alt=\"GitHub code size in bytes\" src=\"https://img.shields.io/github/languages/code-size/containerscrew/tiny-tracing\"\u003e\n    \u003cimg alt=\"GitHub last commit\" src=\"https://img.shields.io/github/last-commit/containerscrew/tiny-tracing\"\u003e\n    \u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/containerscrew/tiny-tracing\"\u003e\n    \u003cimg alt=\"GitHub pull requests\" src=\"https://img.shields.io/github/issues-pr/containerscrew/tiny-tracing\"\u003e\n    \u003cimg alt=\"GitHub Repo stars\" src=\"https://img.shields.io/github/stars/containerscrew/tiny-tracing?style=social\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-MIT-blue.svg\"\u003e\n    \u003cimg alt=\"MSRV\" src=\"https://img.shields.io/badge/MSRV-1.96.1-orange\"\u003e\n\u003c/p\u003e\n\n---\n\n## Quickstart\n\nAdd the crate to your project:\n\n```shell\ncargo add tiny-tracing\n```\n\nMinimal setup — text output at INFO level, nothing else needed:\n\n```rust\nuse tiny_tracing::Logger;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    Logger::new().init()?;\n\n    tiny_tracing::info!(\"Application started\");\n    Ok(())\n}\n```\n\n## Configuration\n\nThe builder API exposes every knob through chainable methods:\n\n```rust\nuse tiny_tracing::{Logger, LogFormat, Level, Output};\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    Logger::new()\n        .with_level(Level::DEBUG)                  // TRACE | DEBUG | INFO | WARN | ERROR\n        .with_format(LogFormat::Json)              // Text | Json\n        .with_env_filter(\"info,my_crate=trace\")    // per-target EnvFilter, on top of level\n        .with_file(true)                           // show source file in log lines\n        .with_target(false)                        // hide module path\n        .with_output(Output::Both(\"app.log\".into())) // stdout + file\n        .init()?;\n    Ok(())\n}\n```\n\n| Method | Default | Description |\n|---|---|---|\n| `with_level(Level::DEBUG)` | `Level::INFO` | Global log level (`tracing::Level`); `with_env_filter` refines it per-target |\n| `with_format(LogFormat::Json)` | `LogFormat::Text` | Output format |\n| `with_env_filter(\"info,my_crate=debug\")` | none | Per-target filter via `EnvFilter`, layered on the level |\n| `with_file(true)` | `false` | Show source file path in log lines |\n| `with_target(false)` | `true` | Show module path in log lines |\n| `with_output(Output::Both(\"app.log\".into()))` | `Output::Stdout` | Write to stdout, a file, or both |\n\n### Output destinations\n\n`with_output` takes an `Output`: `Stdout` (default), `File(path)`, or `Both(path)`.\nFile output is opened in append mode (created if missing) with synchronised,\nblocking writes — no background thread, no guard to keep alive. ANSI colours are\nkept on stdout but stripped from the file, so the on-disk log stays clean.\n\nNeed to load config from a string (env var, TOML)? `LogFormat` implements `FromStr`,\nand `tracing::Level` does too:\n\n```rust\nuse tiny_tracing::{LogFormat, Level};\n\nlet format: LogFormat = \"json\".parse()?;\nlet level: Level = \"debug\".parse()?;\n# Ok::\u003c_, Box\u003cdyn std::error::Error\u003e\u003e(())\n```\n\n## Examples\n\nRunnable examples live under [`examples/`](./examples):\n\n```bash\ncargo run --example basic       # text output at INFO\ncargo run --example json        # JSON output at DEBUG, with file locations\ncargo run --example env_filter  # per-target filter (respects RUST_LOG)\ncargo run --example file        # write to stdout + a file at once\n```\n\n## Safety\n\nThe library calls `tracing_subscriber::try_init()` internally — calling `init()` more\nthan once returns a `LoggerError::TryInitError` instead of panicking. No `unsafe` code\nanywhere in the crate.\n\n## License\n\n`tiny-tracing` is distributed under the terms of the [MIT](./LICENSE) license.\n\n## Development\n\n```bash\ngit clone https://github.com/containerscrew/tiny-tracing.git\ncd tiny-tracing\n\ncargo test                                        # unit + integration + doc-tests\ncargo fmt --all -- --check                        # check formatting\ncargo clippy --all-targets --all-features -- -D warnings\n```\n\nReleases are automated via [cocogitto](https://docs.cocogitto.io/) (Conventional Commits).\nSee the [release skill](.claude/skills/release/SKILL.md) for the full workflow.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainerscrew%2Ftiny-tracing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontainerscrew%2Ftiny-tracing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainerscrew%2Ftiny-tracing/lists"}