Debugging a program with tons of output? Pass them to timbre
- Pure zig, even the regex lib
- Log filter with regex!
- Categorize your logs to each filter
- [Optional] toml configuration
./app_with_tons_of_output | timbreStructured logs add soundness to the noise of development. Add custom filters and categories to timbre with a configuration file to chop those logs in their respective files.
ls -l .timbre/
error.log
warn.log
info.log
debug.log
# Process logs with default settings
./app | timbre
# Use custom configuration
./app | timbre --config=timbre.toml
# Enable verbose output
./app | timbre --verbose[timbre]
log_dir = "/var/log/timbre"
[log_level]
debug = "debug"
warn = "warn(ing)?"
error = "error|exception|fail"- Zig 0.15.0 or later
-
First get Docker
- Download Docker Desktop (for Windows and Mac)
- Use your package manager in Linux, i.e.
apt,pacman, etc... - Or just run:
curl -fsSL https://get.docker.com | sh -
-
Get code,
git clone github.com/ballast-dev/timbre.git && cd timbre -
Build image,
docker build -t timbre:latest - < Dockerfile -
Jump into image,
docker run -it --rm -v $(pwd):/app -w /app timbre:latest
Timbre uses Zig's build system for cross-compilation to various platforms. The build system automatically detects your platform and builds the appropriate version by default.
# Build for your current platform (debug)
zig build
# Build with release optimizations
zig build --release=fastTimbre supports building for multiple platforms:
zig build allzig-out/
|-- aarch64-linux-musl
|-- aarch64-macos
|-- aarch64-windows
|-- x86_64-linux-musl
|-- x86_64-macos
`-- x86_64-windows
Tests can be run for any target platform:
zig build test.
├── src/ # Source files
│ ├── main.cpp # Main entry point
│ ├── timbre.cpp # Core audio processing
│ ├── config.cpp # Configuration handling
│ └── log.cpp # Logging utilities
├── inc/ # Header files
├── tests/ # Test files
└── build.zig # Build system definition
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the license file for details.