Crates.io | sayaka |
lib.rs | sayaka |
version | |
source | src |
created_at | 2025-04-12 06:31:51.442651+00 |
updated_at | 2025-04-12 06:48:11.987396+00 |
description | some simple colorful debugging functions |
homepage | |
repository | |
max_upload_size | |
id | 1630663 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Sayaka is a lightweight Rust debugging toolkit that provides concise and practical macros to assist in development debugging.
Add the dependency to your Cargo.toml
:
[dependencies]
sayaka = "0.2.0"
or use the cargo command in you commandline.
cargo add sayaka
use sayaka::{debugln, debug_var, debug_fn};
fn main() {
let name = "world";
// Print simple debug information
debugln!("Hello, {}!", name);
// Print variable value and type
debug_var!(name);
// Track function calls and their parameters
my_function(42);
}
fn my_function(value: i32) {
debug_fn!(value);
// Function body...
}
Sayaka can be configured through two environment variables:
SAYAKA_DEBUG
: Set to a non-zero value to enable debug outputSAYAKA_NO_COLOR
: Set to a non-zero value to disable colored outputExamples:
# Enable debug output
SAYAKA_DEBUG=1 cargo run
# Enable debug but disable colored output
SAYAKA_DEBUG=1 SAYAKA_NO_COLOR=1 cargo run
debugln!($fmt, ...)
: Prints debug information, similar to println!
formatdebug_var!($var1, $var2, ...)
: Prints detailed information about one or more variablesdebug_fn!($arg1, $arg2, ...)
: Prints current function name and its parametersMIT