transactionlog

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 3 Imported by: 0

README

Transaction Log

This package provides transaction logging for tracking business operations and external API calls.

Usage

Initialize and use the transaction logger:

import "github.com/mariusfa/golf/logging/transactionlog"

// In main function
appName := "todo"
transactionlog.SetAppName(appName)

// Used for logging transactions
transactionlog.Info("User created successfully")
transactionlog.Error("Payment processing failed")

Purpose

Used for logging:

  • Business transactions and operations
  • External API calls and responses
  • Audit trails for compliance
  • Performance monitoring of critical operations

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransLogger

func NewTransLogger(appName string) *slog.Logger

func RequestInfo

func RequestInfo(
	ctx context.Context,
	requestMethod string,
	requestPath string,
	requestBody string,
)

func ResponseInfo

func ResponseInfo(
	ctx context.Context,
	durationMs int,
	status int,
	responseBody string,
)

func SetAppName

func SetAppName(appName string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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