tracelog

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 3 Imported by: 0

README

Trace log package

This is a package for logging inside of app. Typical used for error logging explicit.

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"
translog.SetAppName(appName)

// Used elsewhere in the app
translog.Info("This is an info message")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(payload string, userId string, requestId string)

func Info

func Info(payload string, userId string, requestId string)

func SetAppName

func SetAppName(appName string)

Types

type TraceLogger

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

func GetLogger added in v0.14.0

func GetLogger() *TraceLogger

func NewTraceLogger

func NewTraceLogger(appName string) *TraceLogger

func (*TraceLogger) Error

func (tl *TraceLogger) Error(payload string, userId string, requestId string)

func (*TraceLogger) Info

func (tl *TraceLogger) Info(payload string, userId string, requestId string)

Jump to

Keyboard shortcuts

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