applog

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

App Log

This package provides general application logging with structured output.

Usage

Initialize the logger in main and use throughout the app:

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

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

// Used elsewhere in the app
applog.Info("Application started successfully")
applog.Debug("Processing user input", map[string]interface{}{
    "userId": "123",
    "action": "login",
})
applog.Error("Failed to connect to database")

Purpose

General purpose logging for:

  • Application lifecycle events
  • Debug information during development
  • General information and error messages
  • Structured logging with JSON output

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error added in v0.17.0

func Error(payload string)

func Errorf added in v0.17.0

func Errorf(payload string, error error)

func Info

func Info(payload string)

func Infof added in v0.17.0

func Infof(format string, v ...any)

func NewAppLogger

func NewAppLogger(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