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
+63-41Lines changed: 63 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,6 @@
9
9
10
10
TraceViz is a Ruby library designed to trace and visualize events executed in a block of code. It is useful for logging, debugging, and generating diagrams to understand code execution and flow.
11
11
12
-
> **Note:** The diagram generation feature is currently under development.
13
-
14
12
The gem allows you to customize how much detail you want to see, such as method calls, parameters, return values, and execution times.
15
13
16
14
## Demo
@@ -143,12 +141,14 @@ TraceViz.trace(
143
141
},
144
142
filters: [
145
143
:exclude_internal_call,
146
-
include_classes: [Example]
144
+
include_classes: {
145
+
classes: [Example]
146
+
}
147
147
],
148
148
export: {
149
149
enabled:true,
150
150
path:"tmp",
151
-
format::txt,
151
+
format::txt,# Select :mermaid to export a mermaid diagram
152
152
overwrite:false,
153
153
}
154
154
) do
@@ -159,8 +159,6 @@ end
159
159
160
160
</details>
161
161
162
-
**Output**
163
-
164
162
<detailsopen>
165
163
<summary>Sample Output</summary>
166
164
@@ -178,45 +176,69 @@ Final result: 24
178
176
179
177
</details>
180
178
179
+
<detailsopen>
180
+
<summary>Sample Diagram</summary>
181
+
182
+
```mermaid
183
+
sequenceDiagram
184
+
box rgb(224, 236, 221) Example
185
+
participant E as Example
186
+
end
187
+
E ->> E: perform_task(x: 5, y: 7)
188
+
Note over E: 24
189
+
activate E
190
+
E ->> E: add_numbers(a: 5, b: 7)
191
+
Note over E: 24
192
+
activate E
193
+
E ->> E: multiply_by_factor(value: 12, factor: 2)
194
+
Note over E: 24
195
+
deactivate E
196
+
E ->> E: log_result(result: 24)
197
+
Note over E: nil
198
+
deactivate E
199
+
```
200
+
201
+
</details>
202
+
181
203
### Configuration Options
182
204
183
205
TraceViz provides extensive configuration options to customize tracing behavior.
184
206
185
-
| Group | Option | Type | Default Value | Description |
0 commit comments