logger

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ActivityID generate uuid
	ActivityID key = "activityID"

	// CreatedBy who created logger process
	CreatedBy key = "createdBy"

	// Email who created logger process
	Email key = "email"

	// PhoneNumber who created logger process
	PhoneNumber key = "phoneNumber"

	// UserRole who created logger process
	UserRole key = "role"

	// CMSRole who created logger process
	CMSRole key = "cmsRole"

	// IsInfluencer check log using elastic
	IsInfluencer key = "isInfluencer"
)

Variables

View Source
var Logger logger

Logger instance of logger

Functions

func APILogger

func APILogger(ctx context.Context, method, path string, body interface{})

APILogger api logger

func DetailLoggerError

func DetailLoggerError(ctx context.Context, command, details string, err ...interface{})

DetailLoggerError detail logger error

func DetailLoggerInfo

func DetailLoggerInfo(ctx context.Context, command, details string, logData interface{})

DetailLoggerInfo detail logger info

func DetailLoggerWarn

func DetailLoggerWarn(ctx context.Context, command, details string, warn ...interface{})

DetailLoggerWarn detail logger warning

func FormatDate

func FormatDate(time time.Time) string

FormatDate format date

func InitLogger

func InitLogger(env string, name string)

InitLogger create logger

Types

type LogJSON

type LogJSON struct {
	HeaderRequest string `json:"header"`
	Request       string `json:"request"`
	Response      string `json:"response"`
}

Jump to

Keyboard shortcuts

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