jsonprinter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugJSONLogger

type DebugJSONLogger interface {
	JSONLogger
	EnableDebugLogging(bool)
}

DebugJSONLogger allowed you to also toggle debug messages on and off while also pulling in JSONLogger

type JSONLogger

type JSONLogger interface {
	EnablePrettyPrint(bool)
	EnableAuditMode(bool)
	OverridePrinter(overrides.Overrider)
	Send(*jsonmessage.JSONMessage)
	Flush() chan bool
}

JSONLogger is a logger that implements the functions of this package

type JSONPrinter

type JSONPrinter struct {
	FinishedChan chan bool
	// contains filtered or unexported fields
}

JSONPrinter consumes JSON Logs and sends them to the current output

func New

func New(buffer uint) *JSONPrinter

New created a empty JSON Printer and starts the printer ready for messages.

func (*JSONPrinter) EnableAuditMode

func (j *JSONPrinter) EnableAuditMode(toggle bool)

EnableAuditMode will cause the logger to slow down if it us unable to process logs fast enough. Consider using this with a high buffer count.

func (*JSONPrinter) EnableDebugLogging

func (j *JSONPrinter) EnableDebugLogging(toggle bool)

EnableDebugLogging signals the Logger to print debug messages.

func (*JSONPrinter) EnablePrettyPrint

func (j *JSONPrinter) EnablePrettyPrint(toggle bool)

EnablePrettyPrint signals the Logger to print human readable messages.

func (*JSONPrinter) Flush

func (j *JSONPrinter) Flush() chan bool

Flush stops the logger from consuming more messages. Flush returns a chan bool to tell you when all messages have been printed. The channel will be closed once all messages have been flushed.

func (*JSONPrinter) OverridePrinter

func (j *JSONPrinter) OverridePrinter(override overrides.Overrider)

OverridePrinter is used to insert your own function for hijacking the message on the way to the console. This allows you to push the log message to where ever you want.

func (*JSONPrinter) Send

func (j *JSONPrinter) Send(msg *jsonmessage.JSONMessage)

Send takes a pointer to a JSONMessage and send it to the printer. If the logger is already shutdown then it will just silently consume the message.

Jump to

Keyboard shortcuts

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