{"id":20720213,"url":"https://github.com/zaaack/debug-rs","last_synced_at":"2026-03-16T16:08:09.307Z","repository":{"id":55035436,"uuid":"99637471","full_name":"zaaack/debug-rs","owner":"zaaack","description":"A debug crate for rust inspired by nodejs debug module.","archived":false,"fork":false,"pushed_at":"2021-01-14T00:15:38.000Z","size":66,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T18:52:36.655Z","etag":null,"topics":["color","debug","rust"],"latest_commit_sha":null,"homepage":"","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/zaaack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-08T01:45:07.000Z","updated_at":"2021-03-14T03:18:03.000Z","dependencies_parsed_at":"2022-08-14T09:40:58.903Z","dependency_job_id":null,"html_url":"https://github.com/zaaack/debug-rs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaaack%2Fdebug-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaaack%2Fdebug-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaaack%2Fdebug-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaaack%2Fdebug-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaaack","download_url":"https://codeload.github.com/zaaack/debug-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250450471,"owners_count":21432657,"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":["color","debug","rust"],"created_at":"2024-11-17T03:19:39.564Z","updated_at":"2026-03-16T16:08:09.247Z","avatar_url":"https://github.com/zaaack.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# debug-rs \u0026emsp; [![Build Status]][travis] [![Latest Version]][crates.io] [![docs]][docs.rs] [![License]][License Link]\n\n[Build Status]: https://api.travis-ci.org/zaaack/debug-rs.svg?branch=master\n[travis]: https://travis-ci.org/zaaack/debug-rs\n[Latest Version]: https://img.shields.io/crates/v/debug-rs.svg\n[crates.io]: https://crates.io/crates/debug-rs\n[docs]: https://docs.rs/debug-rs/badge.svg\n[docs.rs]: https://docs.rs/debug-rs/\n[License]: https://img.shields.io/badge/license-MIT-blue.svg\n[License Link]: https://github.com/zaaack/debug-rs/blob/master/LICENSE\n\nA debug crate for rust inspired by NodeJS [debug](https://github.com/visionmedia/debug) module.\n\n## Features\n\n* colored\n* including crate name, file name and line\n* filtered by glob patterns.\n\n## Install\n\n```toml\ndebug-rs = \"*\"\n```\n\nor using cargo-edit\n```sh\ncargo add debug-rs\n```\n\n## Usage\nHere is the code in examples folder:  \n```rust\n#[macro_use]\nextern crate debug_rs;\n\n\nfn main() {\n    debug!(666, 33, \"aaa\");\n\n    debug!(vec![1, 2, 3]);\n\n    debugf!(\"num: {}, str: {},\", 8, \"129\");\n    debugf!(\"num: {:?}, str: {:?},\", 129, \"8\");\n}\n```\n\nThen run with environment variable `DEBUG=debug:examples*` (because the examples' package name is still `debug`):\n\n![](docs/out.png)\n\nIf environment variable `DEBUG` is undefined, then it won't print anything.\n\n## Windows\n\nRunning with env variables in windows shell might be a little different:\n\n```sh\nDEBUG=*,-not_this cargo run # for *unix\n# or\nset DEBUG=*,-not_this; cargo run # for windows\n# or\n$env:DEBUG = \"*,-not_this\"; cargo run # for PowerShell\n```\n\n## DEBUG format\n\n1. Single glob pattern for `\u003cpackage name\u003e:\u003cfile name\u003e`: e.g. `DEBUG=debug*`\n2. Multi glob patterns separated by comma: e.g. `DEBUG=debug:examples*,hyper*,`\n3. Exclude global patterns by prefix \"-\": e.g. `DEBUG=*,-not_this*`\n\n\n## Output format\n\n```\n\u003cpackage name\u003e:\u003cfile name\u003e:L\u003cline number\u003e ...custom variables\n```\n\n## Performance\n\n`debug_build_only` feature can make debug macro won't generate any code in release mode, and default is turn on. you can disable it by config features in Cargo.toml.\n\nWorking in release mode:\n```toml\n\n[dependencies]\ndebug-rs = { version = \"*\", default-features=false }\n```\n\nControlled by features:\n```toml\n[dependencies]\ndebug-rs = { version = \"*\", default-features=false, features=[\"disable\"] }\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaaack%2Fdebug-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaaack%2Fdebug-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaaack%2Fdebug-rs/lists"}