pp alternatives and similar packages
Based on the "Logging" category.
Alternatively, view pp alternatives based on common mentions on social networks and blogs.
-
seelog
Seelog is a native Go logging library that provides flexible asynchronous dispatching, filtering, and formatting. -
httpretty
Package httpretty prints the HTTP requests you make with Go pretty on your terminal. -
go-logger
Simple logger for Go programs. Allows custom formats for messages. -
rollingwriter
Rolling writer is an IO util for auto rolling write in go. -
sqldb-logger
A logger for Go SQL database driver without modifying existing *sql.DB stdlib usage. -
logrusiowriter
io.Writer implementation using logrus logger [managed by soy-programador] -
loggo
A logging library for Go. Doesn't use the built in go log standard library, but instead offers a replacement. -
ozzo-log
A Go (golang) package providing high-performance asynchronous logging, message filtering by severity and category, and multiple message targets. -
gologger
Simple easy to use log lib for go, logs in Colored Cosole, Simple Console, File or Elasticsearch. -
mlog
A simple logging module for go, with a rotating file feature and console logging. -
noodlog
๐ Parametrized JSON logging library in Golang which lets you obfuscate sensitive data and marshal any kind of content. -
Kiwi Logs&Context
Fast, structured, with filters and dynamic sinks. No levels. Logger & context keeper for Go language ๐ฅ It smells like a mushroom. -
gomol
Gomol is a library for structured, multiple-output logging for Go with extensible logging outputs -
kemba
A tiny debug logging tool. Ideal for CLI tools and command applications. Inspired by https://github.com/visionmedia/debug
InfluxDB - Power Real-Time Data Analytics at Scale
Do you think we are missing an alternative of pp or a related project?
Popular Comparisons
README
pp
Colored pretty printer for Go language
Usage
Just call pp.Print()
.
import "github.com/k0kubun/pp/v3"
m := map[string]string{"foo": "bar", "hello": "world"}
pp.Print(m)
API
fmt package-like functions are provided.
pp.Print()
pp.Println()
pp.Sprint()
pp.Fprintf()
See the documentation for API details.
Configuration
They can be customized globally with pp.Default
.
pp.Default.SetColoringEnabled(false)
pp.Println() // no color
You can also create individual instances that do not interfere with the default printer:
mypp := pp.New()
mypp.SetColoringEnabled(false)
mypp.SetExportedOnly(true)
mypp.Println()
See PrettyPrinter documentation for all available configurations.
Custom colors
If you require, you may change the colors (all or some) for syntax highlighting:
// Create a struct describing your scheme
scheme := pp.ColorScheme{
Integer: pp.Green | pp.Bold,
Float: pp.Black | pp.BackgroundWhite | pp.Bold,
String: pp.Yellow,
}
// Register it for usage
pp.Default.SetColorScheme(scheme)
Look into ColorScheme struct for the field names.
If you would like to revert to the default highlighting, you may do so by calling pp.ResetColorScheme()
.
Out of the following color flags, you may combine any color with a background color and optionally with the bold parameter. Please note that bold will likely not work on the windows platform.
// Colors
Black
Red
Green
Yellow
Blue
Magenta
Cyan
White
// Background colors
BackgroundBlack
BackgroundRed
BackgroundGreen
BackgroundYellow
BackgroundBlue
BackgroundMagenta
BackgroundCyan
BackgroundWhite
// Other
Bold
// Special
NoColor
Demo
Timeline
UserStream event
Works on windows
License
MIT License
*Note that all licence references and agreements mentioned in the pp README section above
are relevant to that project's source code only.