Skip to content

Commit 3fcd997

Browse files
committed
added to docs
1 parent d4d656f commit 3fcd997

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ The record will capture information (under the `"payload"` field of the json rec
3535
"name" : "some_function",
3636
...
3737
},
38+
"trace_module": {
39+
"tracer_id": "asdfase-234234sdafs-aerwer",
40+
"thread_id": "default",
41+
"hook_id": "some_function",
42+
...
43+
}
3844
"call_id": "asfda2323-52sdfasd",
3945
"timestamps": {
4046
"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
5157
}
5258
```
5359

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.
5567

5668
You can trace nested calls by decorating the relevant functions. For instance:
5769

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "impulse_core"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = ""
55
authors = ["sudowoodo200 <sudowoodo200@gmail.com>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)