logging

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package logging provides structured, leveled logging for the JumpGate daemon using Go's standard library log/slog package. It supports JSON and text formats, configurable log levels, and consistent attribute naming across all modules.

Index

Constants

View Source
const (
	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
)

Level constants mirror slog levels for external configuration.

View Source
const (
	// Module identifies the subsystem (e.g., "webhook", "deploy", "docker").
	AttrModule = "module"

	// App-level attributes.
	AttrAppName      = "app_name"
	AttrDeploymentID = "deployment_id"
	AttrCommitHash   = "commit_hash"
	AttrRepoURL      = "repo_url"
	AttrContainerID  = "container_id"
	AttrStatus       = "status"

	// Network attributes.
	AttrClientIP = "client_ip"
	AttrPort     = "port"

	// Error attribute.
	AttrError = "error"
)

Common attribute keys used across all modules to ensure consistency.

Variables

This section is empty.

Functions

func Init

func Init(level, format string)

Init configures the global structured logger. Call once at daemon startup.

  • level: one of "debug", "info", "warn", "error"
  • format: "json" or "text"

func Module

func Module(name string) slog.Attr

Module returns an slog.Attr identifying the calling module.

Types

This section is empty.

Jump to

Keyboard shortcuts

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