OLD | NEW |
1 # Debugging with ScopedLogger | 1 # Debugging with ScopedLogger |
2 | 2 |
3 ## Overview | 3 ## Overview |
4 | 4 |
5 ScopedLogger is a logger that shows nested calls by indenting. | 5 ScopedLogger is a logger that shows nested calls by indenting. |
6 | 6 |
7 For example, if you were debugging a layout issue you could add a ScopedLogger | 7 For example, if you were debugging a layout issue you could add a ScopedLogger |
8 to the top of the `LayoutBlock::layout` function: | 8 to the top of the `LayoutBlock::layout` function: |
9 | 9 |
10 ```c++ | 10 ```c++ |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 The macro names are cumbersome to type, but most editors can be configured to | 95 The macro names are cumbersome to type, but most editors can be configured to |
96 make this easier. For example, you can add the following to a Sublime Text key | 96 make this easier. For example, you can add the following to a Sublime Text key |
97 binding file to make Ctrl+Alt+L insert a ScopedLogger: | 97 binding file to make Ctrl+Alt+L insert a ScopedLogger: |
98 | 98 |
99 ``` | 99 ``` |
100 { "keys": ["ctrl+alt+l"], "command": "insert", | 100 { "keys": ["ctrl+alt+l"], "command": "insert", |
101 "args": {"characters": "WTF_CREATE_SCOPED_LOGGER(logger, \"msg\");"} | 101 "args": {"characters": "WTF_CREATE_SCOPED_LOGGER(logger, \"msg\");"} |
102 } | 102 } |
103 ``` | 103 ``` |
OLD | NEW |