Skip to content

Commit 8912184

Browse files
authored
Fix locking for log. (#114)
1 parent 42de6df commit 8912184

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lightstep_span.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ void LightStepSpan::Log(std::initializer_list<
300300
for (const auto& field : fields) {
301301
*key_values->Add() = ToKeyValue(field.first, field.second);
302302
}
303+
std::lock_guard<std::mutex> lock_guard{mutex_};
303304
logs_.emplace_back(std::move(log));
304305
} catch (const std::exception& e) {
305306
logger_.Error("Log failed: ", e.what());

0 commit comments

Comments
 (0)