package
0.0.0-20250128035417-84048cf2426f
Repository: https://github.com/jonesrussell/goforms.git
Documentation: pkg.go.dev

# README

Logging Package

This package provides unified logging functionality using zap.

Responsibilities

  • Structured logging interface
  • Log level management
  • Field-based logging
  • Fx event logging
  • Testing utilities

Key Components

  • Logger: Main logging interface
  • FxEventLogger: Uber Fx event logging
  • LoggerFactory: Logger creation and configuration
  • Field helpers (String, Int, Bool, Error, etc.)

Usage

logger := logging.NewLogger(debug, appName)
logger.Info("message", logging.String("key", "value"))

# Functions

Any creates a field with any value.
Bool creates a boolean field.
Duration creates a duration field.
Error creates an error field.
Int creates an integer field.
Int64 creates a 64-bit integer field.
NewFactory creates a new logger factory.
NewLogger creates a new logger instance.
NewTestLogger creates a logger suitable for testing.
String creates a string field.
Uint creates an unsigned integer field.

# Structs

Factory creates loggers based on configuration.
FxEventLogger implements fxevent.Logger interface using our Logger.

# Interfaces

Logger defines the interface for logging operations This interface abstracts the underlying logging implementation, allowing for easy mocking in tests and flexibility to change the logging backend without affecting application code.

# Type aliases

Field represents a logging field.