logger

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogCreatedSuccess

func LogCreatedSuccess(entityName string, attributes interface{})

LogCreatedSuccess registers successful creation logs

func LogDeletedSuccess

func LogDeletedSuccess(entityName string, attributes interface{})

LogDeletedSuccess registers successful deletion logs

func LogError

func LogError(errorMessage string, errorDetails string)

LogError registra logs de erro em um arquivo separado para o dia atual

func LogUpdatedSuccess

func LogUpdatedSuccess(entityName string, attributes interface{})

LogUpdatedSuccess registers successful update logs

Types

type ActionLog

type ActionLog struct {
	Timestamp  string      `json:"timestamp"`
	ActionType string      `json:"action_type"`
	EntityName string      `json:"entity_name"`
	Attributes interface{} `json:"attributes"`
}

Structure to represent the action log as JSON

type ActionType

type ActionType int

ActionType defines possible action types

const (
	Create ActionType = iota
	Update
	Delete
)

Jump to

Keyboard shortcuts

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