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 ¶
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 ¶
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 PriorityCritical ¶
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.