@rivascva/dt-idl 1.1.82 → 1.1.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/go/log/utils.go +11 -0
  2. package/package.json +1 -1
package/go/log/utils.go CHANGED
@@ -3,7 +3,9 @@ package log
3
3
  import (
4
4
  "context"
5
5
  "encoding/json"
6
+ "fmt"
6
7
  "maps"
8
+ "runtime"
7
9
  "time"
8
10
 
9
11
  "github.com/RivasCVA/dt-idl/go/utils"
@@ -24,6 +26,15 @@ func toJson(ctx context.Context, m any, kvs map[string]any, lvl string) string {
24
26
  // add the timestamp
25
27
  out["timestamp"] = time.Now().UTC().Format(time.RFC3339)
26
28
 
29
+ // add the caller
30
+ if pc, file, line, ok := runtime.Caller(3); ok {
31
+ fn := runtime.FuncForPC(pc).Name()
32
+ if fn == "" {
33
+ fn = "unknown"
34
+ }
35
+ out["caller"] = fmt.Sprintf("%s:%s:%d", file, fn, line)
36
+ }
37
+
27
38
  // add the actor id
28
39
  if actorId, err := utils.GetActorIdFromContext(ctx); err == nil {
29
40
  out["actorId"] = actorId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivascva/dt-idl",
3
- "version": "1.1.82",
3
+ "version": "1.1.83",
4
4
  "description": "Dream Trade - Interface Definition Language",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",