logging

package module
v0.0.0-...-dd07aca Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageIdFieldKey = "messageId"
	AccountIdFieldKey = "accountId"
	ErrorFieldKey     = "error"
)

Variables

This section is empty.

Functions

func AccountIdField

func AccountIdField(accId string) zap.Field

func ErrorField

func ErrorField(err error) zap.Field

func MessageField

func MessageField(key, msg string) zap.Field

func MessageIdField

func MessageIdField(msgId string) zap.Field

Types

type ILogger

type ILogger interface {
	Debug(msg string, fields ...zap.Field)
	Info(msg string, fields ...zap.Field)
	Warn(msg string, fields ...zap.Field)
	Error(msg string, fields ...zap.Field)
}

func NewDefaultLogger

func NewDefaultLogger(e *env.Configs) (ILogger, error)

func NewFileLogger

func NewFileLogger(e *env.Configs) (ILogger, error)

type LogField

type LogField struct {
	Key   string
	Value interface{}
}

type MockLogger

type MockLogger struct {
	mock.Mock
}

func NewMockLogger

func NewMockLogger() *MockLogger

func (*MockLogger) Debug

func (m *MockLogger) Debug(msg string, fields ...zap.Field)

func (*MockLogger) Error

func (m *MockLogger) Error(msg string, fields ...zap.Field)

func (*MockLogger) Info

func (m *MockLogger) Info(msg string, fields ...zap.Field)

func (*MockLogger) Warn

func (m *MockLogger) Warn(msg string, fields ...zap.Field)

Jump to

Keyboard shortcuts

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