log

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package log provides structured logging utilities and configuration for the service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCtx

func AppendCtx(parent context.Context, attr slog.Attr) context.Context

AppendCtx adds an slog attribute to the provided context so that it will be included in any Record created with such context

func InitStructureLogConfig

func InitStructureLogConfig()

InitStructureLogConfig sets the structured log behavior

func LogOptionalInt64

func LogOptionalInt64(val *int64) slog.Value

LogOptionalInt64 creates an slog.Value for optional int64 pointers. Returns nil value if pointer is nil, otherwise logs the dereferenced value. This helper ensures consistent logging of nullable int64 fields like IDs or timestamps.

Example usage:

slog.InfoContext(ctx, "operation completed",
    "subgroup_id", log.LogOptionalInt64(record.SubgroupID))

Logs:

  • When SubgroupID is nil: "subgroup_id": null
  • When SubgroupID is &123: "subgroup_id": 123

func Priority

func Priority(level string) slog.Attr

Priority creates a slog.Attr for error priority classification

func PriorityCritical

func PriorityCritical() slog.Attr

PriorityCritical creates a slog.Attr for critical errors this is used to identify critical errors in the logs the ones that should be escalated to the team

Types

This section is empty.

Jump to

Keyboard shortcuts

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