Twiggy is a Pythonic logging library that emphasizes structured logging and a fluid, method-chaining API. It aims to be more "Pythonic" than the standard library's `logging` module. The current version is 0.5.1, released on May 12, 2021. The library has a slow release cadence and is marked by its maintainers as "not rock solid (yet)", suggesting it is in a maintenance status rather than active, rapid development.
pip install TwiggyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize Twiggy with default settings (console output) using `quick_setup()` and then log messages with bound names, structured fields, and different severity levels using the global `log` object. Twiggy supports `str.format()` style string formatting.
Evaluate suitability for your project's reliability requirements. Consider more mature logging solutions for high-stakes systems.
Consult the 0.5.0 changelog and API documentation to identify and update usage of any deprecated features. Review the `logging_compat` module if transitioning from standard library logging.
Always ensure `from twiggy import quick_setup, log` and `quick_setup()` are at the start of your application, or use `twiggy.setup()` for more granular control.
Add `from twiggy import quick_setup, log` at the top of your file, and ensure `quick_setup()` is called once early in your application's lifecycle.
Use a logging level method on the `log` object, e.g., `log.info("Your message here")`, `log.debug("Another message")`, etc.Twiggy primarily uses `str.format()` style. Ensure your format string (`"hello {who}"`) matches the arguments (`who='world'`) and avoid mixing with C-style `%` formatting.No dependency data recorded yet.