pretty

package
v0.4.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2017 License: BSD-3-Clause Imports: 6 Imported by: 2

README

pretty function

pretty() will marshal the data to JSON and then log it at the INFO level. The default indention setting is 2 spaces and if set to 0, it will print on a single line.

configuration
pretty({"spaces": 2})
example

message in

{
    "_id": 0,
    "name": "transporter",
    "type": "function"
}

config

pretty({"spaces":0})

log line

INFO[0000]
{"_id":0,"name":"transporter","type":"function"}

config

pretty({"spaces":2})

log line

INFO[0000]
{
  "_id":0,
  "name":"transporter",
  "type":"function"
}

Documentation

Index

Constants

View Source
const (
	DefaultIndent = 2
)

Variables

View Source
var (
	DefaultPrettifier = &Prettify{Spaces: DefaultIndent}
)

Functions

This section is empty.

Types

type Prettify

type Prettify struct {
	Spaces int `json:"spaces"`
}

func (*Prettify) Apply

func (p *Prettify) Apply(msg message.Msg) (message.Msg, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL