Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCORE-2234 Crash in dart due to debug output when app is being torn down #7985

Merged
merged 16 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* Using an empty KeyPath in C API would result in no filtering being done ([#7805](https://github.com/realm/realm-core/issues/7805), since 13.24.0)
* Filtering notifications with backlink columns as last element could sometimes give wrong results ([#7530](https://github.com/realm/realm-core/issues/7530), since 11.1.0)
* Fix crash during client app shutdown when Logger log level is set higher than Info. ([#7969](https://github.com/realm/realm-core/issues/7969), since v13.23.3)

### Breaking changes
* None.
Expand Down
4 changes: 2 additions & 2 deletions src/realm/util/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace realm::util {

namespace {
auto& s_logger_mutex = *new std::mutex;
auto& s_stderr_logger_mutex = *new std::mutex;
std::shared_ptr<util::Logger> s_default_logger;
} // anonymous namespace

Expand Down Expand Up @@ -177,8 +178,7 @@ const std::string_view Logger::level_to_string(Level level) noexcept

void StderrLogger::do_log(const LogCategory& cat, Level level, const std::string& message)
{
static Mutex mutex;
LockGuard l(mutex);
std::lock_guard l(s_stderr_logger_mutex);
// std::cerr is unbuffered, so no need to flush
std::cerr << cat.get_name() << " - " << get_level_prefix(level) << message << '\n'; // Throws
}
Expand Down
Loading