Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CorethJSONFormat ¶
func CorethTermFormat ¶
func FormatLogfmtInt64 ¶
FormatLogfmtInt64 formats n with thousand separators.
func FormatLogfmtUint64 ¶
FormatLogfmtUint64 formats n with thousand separators.
func PrintOrigins ¶
func PrintOrigins(print bool)
PrintOrigins sets or unsets log location (file:line) printing for terminal format output.
Types ¶
type Format ¶
func FormatFunc ¶
FormatFunc returns a new Format object which uses the given function to perform log.Record formatting.
func JSONFormat ¶
func JSONFormat() Format
JSONFormat formats log log.Records as JSON objects separated by newlines. It is the equivalent of JSONFormatEx(false, true).
func JSONFormatEx ¶
JSONFormatEx formats log log.Records as JSON objects. If pretty is true, log.Records will be pretty-printed. If lineSeparated is true, log.Records will be logged with a new line between each log.Record.
func JSONFormatOrderedEx ¶
JSONFormatOrderedEx formats log log.Records as JSON arrays. If pretty is true, log.Records will be pretty-printed. If lineSeparated is true, log.Records will be logged with a new line between each log.Record.
func LogfmtFormat ¶
func LogfmtFormat() Format
LogfmtFormat prints log.Records in logfmt format, an easy machine-parseable but human-readable format for key/value pairs.
For more details see: http://godoc.org/github.com/kr/logfmt
func TerminalFormat ¶
TerminalFormat formats log log.Records optimized for human readability on a terminal with color-coded level output and terser human friendly timestamp. This format should only be used for interactive programs or while developing.
[LEVEL] [TIME] MESSAGE key=value key=value ...
Example:
[DBUG] [May 16 20:58:45] remove route ns=haproxy addr=127.0.0.1:50002
type TerminalStringer ¶
type TerminalStringer interface {
TerminalString() string
}
TerminalStringer is an analogous interface to the stdlib stringer, allowing own types to have custom shortened serialization formats when printed to the screen.