logging

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Error(string, ...interface{})
	Warn(string, ...interface{})
	Info(string, ...interface{})
	Debug(string, ...interface{})
	Trace(string, ...interface{})
}

Logger interface implements a simple logger.

type StructuredLogger

type StructuredLogger struct{}

StructuredLogger is a logger based on logrus.

func NewStructuredLogger

func NewStructuredLogger() StructuredLogger

NewStructuredLogger creates a new structured logger.

func (StructuredLogger) Debug

func (l StructuredLogger) Debug(msg string, fields ...interface{})

Debug logs a debug message.

func (StructuredLogger) Error

func (l StructuredLogger) Error(msg string, fields ...interface{})

Error logs an error message.

func (StructuredLogger) Info

func (l StructuredLogger) Info(msg string, fields ...interface{})

Info logs an info message.

func (StructuredLogger) LogJSON

func (l StructuredLogger) LogJSON(value bool) StructuredLogger

LogJSON determines whether or not to format the logs as JSON.

func (StructuredLogger) SetDefaultFields

func (l StructuredLogger) SetDefaultFields(defaultFields map[string]string) StructuredLogger

SetDefaultFields sets fields to be logged on every use of the logger.

func (StructuredLogger) SetLogLevel

func (l StructuredLogger) SetLogLevel(logLevel string) StructuredLogger

SetLogLevel allows the log level to be set.

func (StructuredLogger) Trace added in v0.9.0

func (l StructuredLogger) Trace(msg string, fields ...interface{})

Trace logs a trace message.

func (StructuredLogger) Warn

func (l StructuredLogger) Warn(msg string, fields ...interface{})

Warn logs an warning message.

Jump to

Keyboard shortcuts

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