Some logging added.

This change is untested!
This commit is contained in:
rony5394
2026-04-13 15:31:06 +02:00
parent 4a33358596
commit d0d5168fd2
7 changed files with 116 additions and 33 deletions

28
shared/trace.go Normal file
View File

@@ -0,0 +1,28 @@
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);
}