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 committed Mar 27, 2024
1 parent 2917b87 commit f532a97
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 f532a97

Please sign in to comment.