logger

package
v0.0.0-...-88db892 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestID key = iota
	System
	IPAddress
	Latitude
	Longitude
	Currency
	SessionID
	UserAgent
	SDKVersion
	JWTSessionData
	IsKbankDisabled
	Is3dsV2Enabled
	Language
)

These constants define common keys used to store and retrieve values from Contexts.

Variables

This section is empty.

Functions

func GetLatLong

func GetLatLong(ctx context.Context) (float64, float64)

GetLatLong defines the function to get the lat/lon float embedded in context key

func GetRemoteIP

func GetRemoteIP(ctx context.Context) string

GetRemoteIP defines the function to get the IP string embedded in context key

func InitLogger

func InitLogger(level LogLevel)

Types

type LogLevel

type LogLevel int
const (
	FATAL LogLevel = iota
	ERROR
	WARN
	INFO
	DEBUG
)

type Logger

type Logger interface {
	Debug(ctx context.Context, message string, args ...interface{})
	Info(ctx context.Context, message string, args ...interface{})
	Warn(ctx context.Context, message string, args ...interface{})
	Error(ctx context.Context, message string, args ...interface{})
	Fatal(ctx context.Context, message string, args ...interface{})
}

Logger defines required logging interface

func New

func New(logtag string) Logger

InitLogger initialises structured logger

Jump to

Keyboard shortcuts

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