Files
blazena/shared/trace.go
rony5394 d0d5168fd2 Some logging added.
This change is untested!
2026-04-13 15:31:06 +02:00

29 lines
421 B
Go

package shared
import (
"log/slog"
"github.com/google/uuid"
);
func NewTraceId()string{
return uuid.New().String();
}
func helper(name string, id *string)slog.Attr{
if id == nil{
return slog.String(name, NewTraceId());
}
return slog.String(name, *id);
}
func NewSlogTrace(id *string)slog.Attr{
return helper("trace", id);
}
func NewSlogOperation(id *string)slog.Attr{
return helper("operation", id);
}