Skip to content

Commit

Permalink
fix: capture isEventReceiverRunning by value
Browse files Browse the repository at this point in the history
Signed-off-by: Daeyeon Jeong <[email protected]>
  • Loading branch information
daeyeon authored and hs0225 committed Mar 27, 2024
1 parent 4be57d6 commit 1a1cdff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deps/node/src/lwnode/aul-event-receiver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ void AULEventReceiver::initLoggerOutput(bool isEventReceiverRunning,
LogKind::user()->tag = tag;
}

LogOption::setDefaultOutputInstantiator([&isEventReceiverRunning]() {
LogOption::setDefaultOutputInstantiator([isEventReceiverRunning]() {
static thread_local std::shared_ptr<Logger::Output> s_loggerOutput;
if (s_loggerOutput == nullptr) {
fprintf(stdout,
"logger type: %s",
isEventReceiverRunning ? "dlog" : "stdout");
s_loggerOutput = isEventReceiverRunning
? std::static_pointer_cast<Logger::Output>(
std::make_shared<DlogOut>())
Expand Down

0 comments on commit 1a1cdff

Please sign in to comment.