Skip to content

Commit 9ec37aa

Browse files
committed
Remove disabled option
1 parent 716ff53 commit 9ec37aa

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

include/glaze/trace/trace.hpp

-21
Original file line numberDiff line numberDiff line change
@@ -62,37 +62,26 @@ namespace glz
6262

6363
std::optional<std::chrono::time_point<std::chrono::steady_clock>> t0{}; // the time of the first event
6464

65-
std::atomic<bool> disabled = false;
6665
std::mutex mtx{};
6766

6867
template <class... Args>
6968
requires(sizeof...(Args) <= 1)
7069
void begin(const std::string_view name, Args&&... args) noexcept
7170
{
72-
if (disabled) {
73-
return;
74-
}
7571
duration(name, 'B', std::forward<Args>(args)...);
7672
}
7773

7874
template <class... Args>
7975
requires(sizeof...(Args) <= 1)
8076
void end(const std::string_view name, Args&&... args) noexcept
8177
{
82-
if (disabled) {
83-
return;
84-
}
8578
duration(name, 'E', std::forward<Args>(args)...);
8679
}
8780

8881
template <class... Args>
8982
requires(sizeof...(Args) <= 1)
9083
void duration(const std::string_view name, const char phase, Args&&... args) noexcept
9184
{
92-
if (disabled) {
93-
return;
94-
}
95-
9685
const auto tnow = std::chrono::steady_clock::now();
9786
trace_event* event{};
9887
{
@@ -115,30 +104,20 @@ namespace glz
115104
requires(sizeof...(Args) <= 1)
116105
void async_begin(const std::string_view name, Args&&... args) noexcept
117106
{
118-
if (disabled) {
119-
return;
120-
}
121107
async(name, 'b', std::forward<Args>(args)...);
122108
}
123109

124110
template <class... Args>
125111
requires(sizeof...(Args) <= 1)
126112
void async_end(const std::string_view name, Args&&... args) noexcept
127113
{
128-
if (disabled) {
129-
return;
130-
}
131114
async(name, 'e', std::forward<Args>(args)...);
132115
}
133116

134117
template <class... Args>
135118
requires(sizeof...(Args) <= 1)
136119
void async(const std::string_view name, const char phase, Args&&... args) noexcept
137120
{
138-
if (disabled) {
139-
return;
140-
}
141-
142121
const auto tnow = std::chrono::steady_clock::now();
143122
trace_event* event{};
144123
{

0 commit comments

Comments
 (0)