A colored pretty printer for Go that outputs syntax-highlighted data structures for debugging.
pp is a Go library that provides colored pretty printing for data structures, making debugging and development output more readable. It offers syntax highlighting similar to code editors, helping developers quickly inspect complex nested objects and maps.
Go developers who need to debug or inspect complex data structures like nested maps, structs, and slices during development.
Developers choose pp for its visually intuitive colored output that mimics code editor syntax highlighting, combined with a familiar fmt-like API and extensive customization options for colors and printer behavior.
Colored pretty printer for Go language
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides syntax-highlighted output similar to code editors, making complex nested structures like maps and slices immediately readable, as demonstrated in the demo images with colored strings, integers, and keys.
Supports global defaults or isolated printer instances with options like SetExportedOnly and SetOmitEmpty, allowing tailored debugging for different scenarios without affecting other code.
Offers familiar functions such as Print, Println, Sprint, and Fprintf, enabling easy drop-in replacement for standard fmt calls in existing Go codebases.
Works on Windows, macOS, and Linux with consistent colored output, though the README notes that bold styling may not function on Windows, ensuring broad usability with minor trade-offs.
Explicitly states that bold styling likely won't work on Windows, reducing visual consistency and effectiveness for users on that platform, which is a documented shortcoming.
The added processing for coloring and pretty printing introduces minor performance costs compared to plain fmt output, which might impact high-frequency debugging or logging scenarios.
Defining custom color schemes requires creating a ColorScheme struct and combining flags like pp.Green | pp.Bold, which can be more involved than simple configuration for casual users seeking quick setup.