log

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package log provides logging functionality to Trickster

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(event string, detail Pairs)

Debug sends an "DEBUG" event to the TricksterLogger

func Error

func Error(event string, detail Pairs)

Error sends an "ERROR" event to the TricksterLogger

func ErrorOnce

func ErrorOnce(key string, event string, detail Pairs) bool

ErrorOnce sends an "ERROR" event to the TricksterLogger only once per key Returns true if this invocation was the first, and thus sent to the TricksterLogger

func Fatal

func Fatal(code int, event string, detail Pairs)

Fatal sends a "FATAL" event to the TricksterLogger and exits the program with the provided exit code

func HasWarnedOnce

func HasWarnedOnce(key string) bool

HasWarnedOnce returns true if a warning for the key has already been sent to the TricksterLoggerr

func Info

func Info(event string, detail Pairs)

Info sends an "INFO" event to the TricksterLogger

func InfoOnce

func InfoOnce(key string, event string, detail Pairs) bool

InfoOnce sends a "INFO" event to the TricksterLogger only once per key. Returns true if this invocation was the first, and thus sent to the TricksterLogger

func Init

func Init()

Init returns a TricksterLogger for the provided logging configuration. The returned TricksterLogger will write to files distinguished from other TricksterLoggers by the instance string.

func Trace

func Trace(event string, detail Pairs)

Trace sends a "TRACE" event to the TricksterLogger

func Warn

func Warn(event string, detail Pairs)

Warn sends an "WARN" event to the TricksterLogger

func WarnOnce

func WarnOnce(key string, event string, detail Pairs) bool

WarnOnce sends a "WARN" event to the TricksterLogger only once per key. Returns true if this invocation was the first, and thus sent to the TricksterLogger

Types

type Pairs

type Pairs map[string]interface{}

Pairs represents a key=value pair that helps to describe a log event

type TricksterLogger

type TricksterLogger struct {
	// contains filtered or unexported fields
}

TricksterLogger is a container for the underlying log provider

var Logger *TricksterLogger

Logger is the handle to the common TricksterLogger

func ConsoleLogger

func ConsoleLogger(logLevel string) *TricksterLogger

ConsoleLogger returns a TricksterLogger object that prints log events to the Console

func (TricksterLogger) Close

func (l TricksterLogger) Close()

Close closes any opened file handles that were used for logging.

Jump to

Keyboard shortcuts

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