You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,12 @@ The record will capture information (under the `"payload"` field of the json rec
35
35
"name":"some_function",
36
36
...
37
37
},
38
+
"trace_module": {
39
+
"tracer_id":"asdfase-234234sdafs-aerwer",
40
+
"thread_id":"default",
41
+
"hook_id":"some_function",
42
+
...
43
+
}
38
44
"call_id":"asfda2323-52sdfasd",
39
45
"timestamps": {
40
46
"start":"2023-08-20 22:05:55.000000",
@@ -51,7 +57,13 @@ The record will capture information (under the `"payload"` field of the json rec
51
57
}
52
58
```
53
59
54
-
This works with functions, methods, classmethods, staticmethods, coroutines, and async generators. If an exception occurs, logging will still happen.
60
+
Each record is uniquely identified by 4 fields:
61
+
- A `call` is every single run of the `traced function`, identified by a `call_id` field in the logs. Each `call` also defines a `trace_log()` context. (see below)
62
+
- A `hook` is a decorator for a specific function, identified by `hook_id`. Functions with hooks are called `traced function`.
63
+
- A `thread` is a collection of `hook`'s, identified by the `thread_id` argument while specifying the `hook`
64
+
- A `module` is an instance of the `ImpulseTracer` class, identified by the `instance_id` attribute and manages a collection of `threads`
65
+
66
+
This works with functions, methods, classmethods, staticmethods, coroutines, and async generators. If an exception occurs, logging will still happen.
55
67
56
68
You can trace nested calls by decorating the relevant functions. For instance:
0 commit comments