From f532a97d49e53bab646f4c77897d3800b95aaf86 Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Wed, 27 Mar 2024 16:58:10 +0900 Subject: [PATCH] fix: capture `isEventReceiverRunning` by value Signed-off-by: Daeyeon Jeong --- deps/node/src/lwnode/aul-event-receiver.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deps/node/src/lwnode/aul-event-receiver.cc b/deps/node/src/lwnode/aul-event-receiver.cc index 97f8e031b4..5a409a4afa 100644 --- a/deps/node/src/lwnode/aul-event-receiver.cc +++ b/deps/node/src/lwnode/aul-event-receiver.cc @@ -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 s_loggerOutput; if (s_loggerOutput == nullptr) { + fprintf(stdout, + "logger type: %s", + isEventReceiverRunning ? "dlog" : "stdout"); s_loggerOutput = isEventReceiverRunning ? std::static_pointer_cast( std::make_shared())