tracelog

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: 4 Imported by: 0

README

Trace Log

This package provides request tracing and error logging for applications.

Usage

Initialize the logger in main and use throughout the app:

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

// Used elsewhere in the app for tracing requests
tracelog.Info("Processing user request")
tracelog.Error("Database connection failed")

Purpose

Typically used for:

  • Request tracing and debugging
  • Error logging with context
  • Application flow monitoring

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(ctx context.Context, payload string)

func Errorf added in v0.17.0

func Errorf(ctx context.Context, payload string, err error)

func Info

func Info(ctx context.Context, payload string)

func Infof added in v0.17.0

func Infof(ctx context.Context, format string, v ...any)

func NewTraceLogger

func NewTraceLogger(appName string) *slog.Logger

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