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
- Dropped support for Revit 2021; minimum version is now Revit 2022
- Removed SQLite and CLEF log formats; JSON is now the preferred format
- Added WPF Trace Listener for capturing binding errors
- Introduced automatic log level detection with customizable keywords
- Enabled pretty JSON output for complex objects in logs
- Added Revit context enrichers for log entries
- Implemented a new single-page settings UI
- Added live geometry count badge for real-time visualization feedback
- Enhanced Python stack trace support for better debugging
- Implemented auto-clean for log files based on rolling intervals
- Updated log file naming to include process ID for easier identification
*[🐍 Python Stack Trace with pyRevit](#-python-stack-trace-with-pyrevit)
33
+
*[Setup](#setup)
34
+
*[Usage](#usage-1)
35
+
*[Output Example](#output-example)
36
+
*[How It Works](#how-it-works)
37
+
*[Configuration](#configuration)
30
38
*[🎛️ User Interface Features](#-user-interface-features)
31
39
*[🔧 Language Support](#-language-support)
32
40
*[💡 Best Practices](#-best-practices)
@@ -128,6 +136,70 @@ print("This will appear in the trace log")
128
136
Console.WriteLine("Direct console output from Python")
129
137
```
130
138
139
+
#### Colored Log Output with Keywords
140
+
141
+
RevitDevTool automatically detects log levels from message content using configurable keywords. This enables colored output even when using `Trace.WriteLine()`:
142
+
143
+
**Prefix Detection (Highest Priority)**
144
+
```csharp
145
+
Trace.WriteLine("[INFO] This will be Information level (blue)");
146
+
Trace.WriteLine("[WARN] This will be Warning level (yellow)");
147
+
Trace.WriteLine("[ERROR] This will be Error level (red)");
148
+
Trace.WriteLine("[FATAL] This will be Critical level (dark red)");
149
+
Trace.WriteLine("[DEBUG] This will be Debug level (gray)");
150
+
```
151
+
152
+
**Keyword Detection (Fallback)**
153
+
```csharp
154
+
Trace.WriteLine("Operation completed successfully"); // "completed" → Info
155
+
Trace.WriteLine("Warning: Memory usage is high"); // "warning" → Warning
156
+
Trace.WriteLine("Error occurred during processing"); // "error" → Error
157
+
Trace.WriteLine("Fatal crash detected in system"); // "fatal" → Critical
158
+
```
159
+
160
+
**Default Keywords (Customizable in Settings)**
161
+
| Level | Default Keywords |
162
+
|-------|-----------------|
163
+
| Information |`info`, `success`, `completed`|
164
+
| Warning |`warning`, `warn`, `caution`|
165
+
| Error |`error`, `failed`, `exception`|
166
+
| Critical |`fatal`, `critical`, `crash`|
167
+
168
+
#### Pretty JSON Output
169
+
170
+
Enable **Pretty JSON** in settings to automatically format complex objects as indented JSON:
171
+
172
+
```csharp
173
+
// Log complex objects with automatic JSON formatting
174
+
varauditLog=new
175
+
{
176
+
EventId=Guid.NewGuid(),
177
+
Timestamp=DateTime.UtcNow,
178
+
User=new { Id="user456", Role="Administrator" },
179
+
Changes=new[]
180
+
{
181
+
new { Property="MaxConnections", OldValue=100, NewValue=200 }
182
+
}
183
+
};
184
+
185
+
Trace.WriteLine(auditLog); // Outputs formatted JSON when Pretty JSON is enabled
The Geometry Visualization system allows you to display transient geometry directly in the Revit 3D view, similar to Dynamo's preview functionality but integrated into your development workflow.
@@ -298,11 +370,95 @@ selected_walls = [doc.GetElement(id) for id in uidoc.Selection.GetElementIds()]
298
370
analyze_walls(selected_walls)
299
371
```
300
372
373
+
### 🐍 Python Stack Trace with pyRevit
374
+
375
+
RevitDevTool provides enhanced Python logging with full stack trace support for pyRevit scripts. This feature captures the Python call stack and displays it alongside your log messages.
376
+
377
+
> **Note**: This feature currently supports **pyRevit** only. Support for RevitPythonShell and standalone IronPython can be added by modifying the `trace.py` helper.
378
+
379
+
#### Setup
380
+
381
+
1. Copy [`trace.py`](source/RevitDevTool/Logging/Python/trace.py) from RevitDevTool to your pyRevit extension folder or script directory
382
+
2. Import the `trace` function in your script
383
+
384
+
#### Usage
385
+
386
+
```python
387
+
# trace.py should be in the same folder or in your pyRevit lib folder
0 commit comments