middlewarelog

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 3 Imported by: 0

README

Middleware log package

This is a package for general logging inside middlewares.

Usage

Here is an example of how to use this package. Init logger in main to be used everywhere in the app.

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

// Used elsewhere in the app
applog.Info("This is an info message", "requestId")
applog.Error("This is an error message", "requestId")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(payload string, requestId string)

func Info

func Info(payload string, requestId string)

func SetAppName

func SetAppName(appName string)

Types

type MiddlewareLogger

type MiddlewareLogger struct {
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger() *MiddlewareLogger

func NewMiddlewareLogger

func NewMiddlewareLogger(appName string) *MiddlewareLogger

func (*MiddlewareLogger) Error

func (al *MiddlewareLogger) Error(payload string, requestId string)

func (*MiddlewareLogger) Info

func (al *MiddlewareLogger) Info(payload string, requestId string)

Jump to

Keyboard shortcuts

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