logger

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mock_logger is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Trace(...interface{})
	Debug(...interface{})
	Info(...interface{})
	Warn(...interface{})
	Error(...interface{})
	Panic(...interface{})
	Fatal(...interface{})
}

Logger type is interface for available logging methods.

type LoggerImpl

type LoggerImpl struct {
	Logger         *log.Entry
	Service        string
	LogLevelStr    string
	PrintStackDump bool
}

LoggerImpl is a struct that extends sirupsen/logrus.

func NewLogger

func NewLogger(serviceName string, level string, stackDumpOnPanic bool) *LoggerImpl

NewLogger will create a new logger implementation.

func NewWebLogger

func NewWebLogger(serviceName string, level string, stackDumpOnPanic bool, exitHandlerFn func()) *LoggerImpl

NewLogger will create a new logger implementation.

func (*LoggerImpl) Debug

func (l *LoggerImpl) Debug(message ...interface{})

Debug log.

func (*LoggerImpl) Error

func (l *LoggerImpl) Error(message ...interface{})

Error (with stack trace in debug mode).

func (*LoggerImpl) Fatal

func (l *LoggerImpl) Fatal(message ...interface{})

Fatal (with stack trace in debug mode). This causes exit(1) without a stack dump by default. Call Panic() to get a stack dump instead.

func (*LoggerImpl) Info

func (l *LoggerImpl) Info(message ...interface{})

Info log.

func (*LoggerImpl) Panic

func (l *LoggerImpl) Panic(message ...interface{})

Panic (with stack trace in debug mode, or if user explicitely sets PrintStackDump).

func (*LoggerImpl) SetOutput

func (l *LoggerImpl) SetOutput(writer io.Writer)

SetOutput will set the log output to the Writer supplied.

func (*LoggerImpl) Trace

func (l *LoggerImpl) Trace(message ...interface{})

Debug log.

func (*LoggerImpl) Warn

func (l *LoggerImpl) Warn(message ...interface{})

Warn log.

type MockLogger

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

MockLogger is a mock of Logger interface

func NewMockLogger

func NewMockLogger(ctrl *gomock.Controller) *MockLogger

NewMockLogger creates a new mock instance

func (*MockLogger) EXPECT

func (m *MockLogger) EXPECT() *MockLoggerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockLogger) Error

func (m *MockLogger) Error(arg0 string)

Error mocks base method

func (*MockLogger) Info

func (m *MockLogger) Info(arg0 string)

Info mocks base method

func (*MockLogger) Warn

func (m *MockLogger) Warn(arg0 string)

Warn mocks base method

type MockLoggerMockRecorder

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

MockLoggerMockRecorder is the mock recorder for MockLogger

func (*MockLoggerMockRecorder) Error

func (mr *MockLoggerMockRecorder) Error(arg0 interface{}) *gomock.Call

Error indicates an expected call of Error

func (*MockLoggerMockRecorder) Info

func (mr *MockLoggerMockRecorder) Info(arg0 interface{}) *gomock.Call

Info indicates an expected call of Info

func (*MockLoggerMockRecorder) Warn

func (mr *MockLoggerMockRecorder) Warn(arg0 interface{}) *gomock.Call

Warn indicates an expected call of Warn

Jump to

Keyboard shortcuts

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