1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-12-24 00:01:31 +02:00

completed schema migration

This commit is contained in:
Lee Brown
2019-05-25 08:26:37 -05:00
parent c19f46e07f
commit 82cd108ed6
21 changed files with 136 additions and 48 deletions

View File

@@ -0,0 +1,19 @@
package logger
import (
"context"
"fmt"
"geeks-accelerator/oss/saas-starter-kit/example-project/internal/platform/web"
)
// WithContext manual injects context values to log message including Trace ID
func WithContext(ctx context.Context, msg string) string {
v, ok := ctx.Value(web.KeyValues).(*web.Values)
if !ok {
return msg
}
cm := fmt.Sprintf("dd.trace_id=%d dd.span_id=%d", v.TraceID, v.SpanID)
return cm + ": " + msg
}