transactionlog

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 3 Imported by: 0

README

Transaction log package

This is a package for transaction logging.

Usage

Here is an example of how to use this package. Start with creating a package in internal/logging and add a file logging.go with the following content:

package logging

import translog "github.com/mariusfa/gofl/v2/logging/trans-log"

var TransLogger *translog.TransLogger

func SetupTransLogger(appName string) {
	TransLogger = translog.NewTransLogger(appName)
}

In the main.go file, you can use the logger like this:

package main

import (
	"<my-module>/internal/logging"

	"github.com/mariusfa/gofl/v2/config"
)

func main() {
	logging.SetupTransLogger("<my-module>")
	transLogger := logging.TransLogger

    // ... rest of the code
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TransLogger

type TransLogger struct {
	// contains filtered or unexported fields
}
var TransLog TransLogger

func NewTransLogger

func NewTransLogger(appName string) TransLogger

func (*TransLogger) Info

func (al *TransLogger) Info(payload string, requestMethod string, event string, status string, durationMs string)

Jump to

Keyboard shortcuts

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