logging

package
v0.0.0-...-193230c Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package logging exposes a global logrus logger configured at init time by the build-tagged files (logging_debug.go / logging_release.go).

Usage:

import "github.com/ShieldNet-360/prompt-gate/agent/internal/logging"
logging.Log.Info("server started")
logging.Log.WithField("addr", addr).Debug("listening")

Index

Constants

This section is empty.

Variables

View Source
var Log = log.New()

Log is the global logger. Every package in the agent should use this instead of the standard log package or fmt.Fprintf(os.Stderr, ...). Debug-level messages are only emitted in debug builds.

Functions

func Go

func Go(label string, fn func())

Go runs fn in a new goroutine guarded by Recover(label). Use it for long-lived background workers (poll loops, flush timers) so a panic in one subsystem degrades that subsystem instead of crashing the agent and black-holing every user's traffic.

func Recover

func Recover(label string)

Recover is the panic backstop for a goroutine. Deferred at the top of a goroutine (or a per-request handler), it turns a panic — which would otherwise terminate the ENTIRE process, since only net/http recovers its own request goroutines — into a logged error. The stack is logged for debugging; the panic value itself is included, so never pass payload bytes to panic().

Types

This section is empty.

Jump to

Keyboard shortcuts

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