logging

package
v0.56.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 3 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{})
	SetLevel(string)
}

Logger interface implements a simple logger.

type MockLogger added in v0.55.4

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

func NewMockLogger added in v0.55.4

func NewMockLogger(t *testing.T) *MockLogger

func (MockLogger) Debug added in v0.55.4

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

Debug logs a debug message.

func (MockLogger) Error added in v0.55.4

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

Error logs an error message.

func (MockLogger) Info added in v0.55.4

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

Info logs an info message.

func (MockLogger) SetLevel added in v0.55.4

func (l MockLogger) SetLevel(logLevel string)

func (MockLogger) Trace added in v0.55.4

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

Trace logs a trace message.

func (MockLogger) Warn added in v0.55.4

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

Warn logs an warning message.

type StructuredLogger

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

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) SetDefaultFields

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

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

func (StructuredLogger) SetLevel added in v0.55.4

func (l StructuredLogger) SetLevel(levelName string)

SetLevel allows the log level to be set.

func (StructuredLogger) SetLogJSON added in v0.55.4

func (l StructuredLogger) SetLogJSON(value bool)

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

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