Commit eb7b085 1 parent b14b9e7 commit eb7b085 Copy full SHA for eb7b085
File tree 1 file changed +16
-16
lines changed
1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -157,51 +157,51 @@ namespace glz
157
157
std::ignore = glz::write_json (std::forward<Args>(args)..., event->args .str );
158
158
}
159
159
}
160
-
160
+
161
161
// Automatically adds the end event when it leave scope
162
162
struct duration_scoper final
163
163
{
164
164
trace& tr;
165
-
166
- duration_scoper (trace& tr, const std::string_view name) noexcept : tr(tr), name(name) {
165
+
166
+ duration_scoper (trace& tr, const std::string_view name) noexcept : tr(tr), name(name)
167
+ {
167
168
if (not tr.disabled ) {
168
169
tr.begin (name);
169
170
}
170
171
}
171
- ~duration_scoper () noexcept {
172
+ ~duration_scoper () noexcept
173
+ {
172
174
if (not tr.disabled ) {
173
175
tr.end (name);
174
176
}
175
177
}
176
178
177
179
const std::string_view name{};
178
180
};
179
-
181
+
180
182
struct async_scoper final
181
183
{
182
184
trace& tr;
183
-
184
- async_scoper (trace& tr, const std::string_view name) noexcept : tr(tr), name(name) {
185
+
186
+ async_scoper (trace& tr, const std::string_view name) noexcept : tr(tr), name(name)
187
+ {
185
188
if (not tr.disabled ) {
186
189
tr.begin (name);
187
190
}
188
191
}
189
- ~async_scoper () noexcept {
192
+ ~async_scoper () noexcept
193
+ {
190
194
if (not tr.disabled ) {
191
195
tr.end (name);
192
196
}
193
197
}
194
198
195
199
const std::string_view name{};
196
200
};
197
-
198
- duration_scoper scope (const std::string_view name) {
199
- return {*this , name};
200
- }
201
-
202
- async_scoper async_scope (const std::string_view name) {
203
- return {*this , name};
204
- }
201
+
202
+ duration_scoper scope (const std::string_view name) { return {*this , name}; }
203
+
204
+ async_scoper async_scope (const std::string_view name) { return {*this , name}; }
205
205
};
206
206
207
207
template <>
You can’t perform that action at this time.
0 commit comments